C language doesn't scan variable after reading that variable as string(or char) instead of integer But the most weird is that it is entering in infinite loop
int main( ){
int answer;
printf("Hello\n");
while (answer != 3){
scanf("%d",&answer);
switch (answer) {
case 3:
break;
default:{
printf("Invalid input\nTry again\n\n");
break;}
}
}
return 0;
}
To find how C language works and fix the problem