Loop problem: Asks a question twice!!!
Hi everyone,
could someone please tell me WHY THE 'Are you sure you want to quit?' question gets asked twice, I've trid to put every possible condition on it but no matter what it is asked twice:
Code:
case 3:
fflush(stdin);
do
{
puts("Are you sure you want to quit ?");
ch = getc(stdin);
if (ch == 'y')
{
printf("Thank you for using\n\n");
exit(0);
}
else if (ch == 'n')
{
puts("That's great!!!");
break;
}
}while(ch != 'n' || ch != 'y');
break;
}
this is the third 'case' of a switch statement.
Any help would be appreciated.