Following along a C tutorial, I entered this code. When I compile and run, it aks for my age, which I enter. But it doesn't display any of the 'if' or 'else' statements. So I hit enter and the window closes. Is there a trick or am I entering the code wrong?
#include <stdio.h>
int main()
{
int age;
printf( "Please enter your age" );
scanf ("%d", &age);
if (age < 100) {
printf ("You are pretty young!\n");
}
else if (age == 100 ) {
printf ( "You are old \n");
}
else {
printf ( "You are really old \n");
}
return 0;
}