how can i do: if (inputChar != ‘Y’) in C?
I have to write a prompt that asks the following:
“Do you wish to continue (y/n)?:”
And I’m supposed to scanf the input of ‘y’ or ‘n’ but I have no idea how to write the if then comparison statement to continue the loop or exit the program. Ideas?
This is all I have so far:
printf("
Would you like to play again (Y/N):");
scanf(" %c", &again_prompt);
if (again_prompt == 'y')
{
go_indicator = 1;
}
else if (again_prompt == 'n');
{
go_indicator = 0;
}
But from my observations, that method definitely does not work. So how do I do it?

