when i am running this code it is giving different behaviur with scanf("%c",&op) as mentioned in this code
Code:
#include<stdio.h>
#include<conio.h>
int main(void)
{
int a,b;
char op;
printf("Enter the number a and b");
scanf("%d\n%d",&a,&b);
printf("Enter the opetration + or - ");
scanf("\n%c",&op); //it is working in this way
// scanf("%c",&op); //not working with this statement
switch(op)
{
case '+':
printf("Sum of the number=%d",a+b);
break;
case '-':
printf("Diff of the number=%d ",a-b);
break;
default:
printf("Wrong operation");
}
getch();
}