easy and basic calculator.
just add your own detail.
Program
#include
#include
#define P printf
#define S scanf
int main(){
float x,y,sum,diff,prod,qou;
P("Enter first integer: ");
S("%f",&x);
P("Enter second integer: ");
S("%f",&y);
sum=x+y;
P("\nThe Sum is:%.2f",sum);
diff=x-y;
P("\nThe Difference is:%.2f",diff);
prod=x*y;
P("\nThe Product is:%.2f",prod);
qou=x/y;
P("\nThe Qoutient is:%.2f",qou);
getch();
return 0;
}
just add your own detail.
Program
#include
#include
#define P printf
#define S scanf
int main(){
float x,y,sum,diff,prod,qou;
P("Enter first integer: ");
S("%f",&x);
P("Enter second integer: ");
S("%f",&y);
sum=x+y;
P("\nThe Sum is:%.2f",sum);
diff=x-y;
P("\nThe Difference is:%.2f",diff);
prod=x*y;
P("\nThe Product is:%.2f",prod);
qou=x/y;
P("\nThe Qoutient is:%.2f",qou);
getch();
return 0;
}
No comments:
Post a Comment
Thanks to given comments.......