I'm trying to implement a simple while loop to let the user enter multiple marks without having to reload the application, for some reason no matter what i seem to enter it always loops.
I've looked using the debugger and it doesn't seem to accept the final scanf() asking whether to repeat itself or not.
int mark = 0;
char grade;
char choice = 'y';
while(choice == 'y')
{
//Request input
printf("enter a mark: ");
scanf("%d", &mark);
//Assess mark
grade = assess(mark);
//Output result
printf("That equals ");
printf("%c", grade);
printf(" when graded\n");
//Repeat?
printf("Again?...\n");
fflush(stdin);
scanf("&c", &choice);
}
I've also tried it with a do - while loop and still no joy, any idea where the problem may lie?