This is a problem in C
. The program Control flow is not as expected. It ask to enter the character in but fail to ask to enter character x.
int foo();
int main(int argc, const char * argv[]) {
foo();
return 0;
}
int foo(){
char in;
char x;
printf("Do you wanna party \n");
if((in = getchar()) == 'y')
printf("Go Sleep!, I was kidding\n");
else
printf("Oh! you are so boaring..\n");
printf("\nOk, Another Question\n");
printf("Wanna Go to Sleep\n");
if((x = getchar()) == 'y')
printf("ok lets go, Sleepy Head\n");
else
printf("No, lets go\n");
return 0;
}