Scanf inside IF statement not working
This is the code, after i enter age:60+ , it goes straight to the output and doesnt execute th scanf inside, thanks for the help
Code:
#include<stdio.h>
int main(void)
{
int age;
char sts;
printf("Enter the age: \n");
scanf("%d", &age);
if(age>59)
{
printf("Enter W for working or R for retired: \n");
scanf("%c", &sts);
if(sts=='W')
printf("Working senior\n");
else
printf("Retired Senior\n");
}
else if(age>20)
printf("Adult \n");
else if(age>12)
printf("Teen \n");
else
printf("Child \n");
return 0;
}