Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- double a,b;
- char choice;
- scanf("%c" ,&choice);
- scanf("%lf %lf",&a ,&b);
- switch (choice)
- {
- case '*':
- printf("%.2lf\n", a*b);
- break;
- case '+':
- printf("%.2lf\n",a+b);
- break;
- case '-':
- printf("%.2lf\n",a-b);
- break;
- case '/':
- printf("%.2lf\n",a/b);
- break;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment