- #1
- 2,168
- 193
Code:
# include <stdio.h>
int main()
{
int n1,n2;
char s;
printf("Enter the first number:");
scanf("%d",&n1);
printf("Enter the second number:");
scanf("%d",&n2);
printf("Type the operation symbol that you want to do:");
scanf("%c",&s);
printf("%c",s);
if (s == '+'){
printf("The sum is %d",n1+n2);
}
if (s == '-'){
printf("The sub is %d",n1-n2);
}
if (s == '/'){
printf("The div is %d",n1/n2);
}
if (s == '*'){
printf("The mul is %d",n1*n2);
}
return 0;
}
This is not working and I couldn't figure out why ..
Code:
Enter the first number:12
Enter the second number:23
Type the operation symbol that you want to do:
Process returned 0 (0x0) execution time : 1.976 s
Press any key to continue.
It stops here. Anyone can see why it doesn't go further ?