LED PANEL

Google It, You'll Get It.

Monday, January 31, 2011

Simple Calculator with Four Operators

#include<"stdio.h">

main()
{
int x, y;
float sum1, sum2, sum3, sum4;

printf("enter the first value \n");
scanf("%d",&x);
printf("enter the second \n");
scanf("%d",&y);

sum1 = x + y;
sum2 = x - y;
sum3 = x * y;
sum4 = x / y;

printf("the x + y is %f", sum1);
printf("\nthe x - y is %f", sum2);
printf("\nthe x * y is %f", sum3);
printf("\nthe x / y is %f", sum4);

}

No comments:

Post a Comment