#include <stdio.h>
#include <conio.h>
void calculator(float a,float b,float *plus,float *diff, float *product, float *divide);
main()
{
float add,sub,mul,div;
float a=32.1, b=10.9;
calculator(a,b,&add,&sub,&mul,&div);
printf("Sum = %f\n",add);
printf("Difference = %f \n",sub);
printf("Product = %f \n",mul);
printf("quotient = %f \n",div);
}
void calculator(float a,float b,float *plus,float *diff, float *product, float *divide)
{
*plus= a+b;
*diff= a -b;
*product=a*b;
*divide=a/b;
}
No comments:
Post a Comment