Can anyone please tell me what is the error and how should i correct it. Its showing the following error in line 10-
"[Error] expected expression before ',' token"
this is my program-
"[Error] expected expression before ',' token"
this is my program-
Code:
#include<stdio.h>
#include<conio.h>
main()
{
int a, b, sum, sub, mul, div;
printf("Enter the two numbers",a,b);
scanf("%d%d", &a, &b);
printf("Enter the choice of operation");
scanf("%d",&sum,&sub,&mul,&div);
switch(+,-,*,/)
{
case "+": sum=a+b;
printf("The sum of %d and %d is %d", a, b, sum);
break;
case "-": sub=a-b;
printf("The difference of %d and %d is %d", a, b, sub);
break;
case "*": mul=a*b;
printf("The product of %d and %d is %d", a, b, mul);
break;
case "/": div=a/b;
printf("The division of %d and %d is %d", a, b, div);
break;
default :print("Enter the correct value");
break;
}
return(0);
getch();
}
Comment