Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main()
- {
- double A, B;
- char Ch;
- scanf("%lf %c %lf", &A, &Ch, &B);
- if(Ch == '+'){
- printf("%.2lf + %.2lf = Sum: %.2lf\n",A, B, A+B);
- }
- else if(Ch == '-'){
- printf("%.2lf - %.2lf = Subtraction: %.2lf\n", A, B, A-B);
- }
- else if(Ch == '*'){
- printf("%.2lf * %.2lf = Multiple: %.2lf\n", A, B, A*B);
- }
- else{
- printf("%.2lf / %.2lf = Divided: %.2lf\n", A, B, A/B);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement