- Code:
#include <stdio.h>
#include <stdlib.h>
main()
{
char name[25];
printf("What is your last name? ");
scanf(" %s", name);
if ((name[0] >= 'P') && (name[0] <= 'S'))
{
printf("You must go to room 2432 ");
printf("for your tickets.\n");
}
else
{
printf("You can get your tickets here.\n");
}
char a;
printf("Press a key to exit.\n");
scanf(" %c", &a;);
return 0;
}
This code compiles fine, but when I try to execute the program, it does not open; and no, it does not open and close right away, it does not open at all.
Am I having a compiler problem? I am using gcc.