#include <stdio.h>
int main()
{
int x, y, i, temp, sum;
char j = 'y';
do
{
...stuff...
printf ("\nPlay again? (y\\n)\n");
scanf("%c",&j);
}
while (j == 'y');
return 0;
}
The program does the operation once and exits, without waiting to get input from user. After running once it shows "press any key to continue". How can this be fixed?