fork download
  1. #include<stdio.h>
  2. int main(void)
  3. {
  4. int a,b,c;
  5. char o;
  6. scanf("%d",&a);
  7. scanf("%c",&o);
  8. scanf("%d",&b);
  9. switch(o)
  10. {
  11. case '+':
  12. c=a+b;
  13. printf("The sum is %d\n",c);
  14. break;
  15. case'-':
  16. c=a-b;
  17. printf("The difference is %d",c);
  18. break;
  19. case '*':
  20. c=a*b;
  21. printf("The product is %d",c);
  22. break;
  23. case '/':
  24. c=a/b;
  25. printf("The quotient is %d",c);
  26. break;
  27. default:
  28. printf("Invalid input\n");
  29. break;
  30. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:30:5: error: expected declaration or statement at end of input
     }
     ^
stdout
Standard output is empty