Let's say I have a program which tells you when you are going to die. I need the user's age for that. But the user can give me his age or birth day.
printf("Tell me your age or brith day\n");
if(scanf("%d", &age)!=1){
printf("error");
}
else if(scanf("%d %d %d", &day,&month,&year)!=3){
printf("error");
I tried it like this but it doesn't work. Only first if works, not the second one.
Again, basically, all I want is to give user 2 different options. 2 different ways to tell me his age.