Please help me with this obviously silly mistake
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<ctime>
int main()
{
srand((unsigned)time(NULL));
int No_of_Q = 0; //number of questions
int m1, m2, ans; //two operands and answer
int ra = 0; //number of right answers
int wa = 0; //number of wrong answers
char c = 'y'; //whether to continue
printf("Let's play multiply!\n");
do
{
printf("How many questions would you like to attempt? ");
scanf_s("%d", &No_of_Q);
printf("\n");
for(int i=1; i<=No_of_Q; i++)
{
m1=(rand()%10 + 1);
m2=(rand()%10 + 1);
printf("\nWhat is %d x %d = ", m1, m2);
scanf_s("%d",&ans);
if(ans== m1*m2)
{
printf("Your answer is correct!\n");
ra++ ;
}
else{
printf("Wrong, the correct answer is %d.\n", m1*m2);
wa++ ;
}
}
printf("\n\nOut of %d answers, %d were correct and %d wrong.\n",No_of_Q, ra, wa);
if(wa==0)
printf("Congratulations!\n");
else
printf("Better luck next time!\n");
printf("Continue game? ");
scanf_s("%c", &c ); /*-------CANNOT GET THIS TO PERFORM--------------*/
//printf("%c",c);
}
while(c=='y');
return 0;
}
I am using vs 2012 express edition. I cannot get my program to scan answer to continue at the end of the program. The while statement at the end doesn't compute. Please help.