You are viewing a single comment's thread. Return to all comments →
int main() { int a,b; float c,d; // printf ("enter first integer digit"); scanf ("%d",&a); // printf ("enter second integer digit"); scanf ("%d",&b); // printf ("enter first float digit"); scanf ("%f",&c); // printf ("enter first float digit"); scanf ("%f",&d); int sum = a+b; int differnce= a-b; printf ("%d %d " , sum, differnce);
printf ("\n");
float add= c+d; float subtract= c-d; printf ("%.1f %.1f " , add,subtract);
return 0;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Sum and Difference of Two Numbers
You are viewing a single comment's thread. Return to all comments →
include
int main() { int a,b; float c,d; // printf ("enter first integer digit"); scanf ("%d",&a); // printf ("enter second integer digit"); scanf ("%d",&b); // printf ("enter first float digit"); scanf ("%f",&c); // printf ("enter first float digit"); scanf ("%f",&d); int sum = a+b; int differnce= a-b; printf ("%d %d " , sum, differnce);
float add= c+d; float subtract= c-d; printf ("%.1f %.1f " , add,subtract);
}