Question.Use rand to produce two positive one-digit integers.It should then type a question such as:
How much is 6 times 7?
The student then types the awnser .Your program checks the students awnser.If it is correct, printf "Very good!" and then ask another multiplication question.If the awnser is wrong printf"No.Please try again" and then let the student try the same question repeatedly until he gets it right.Note.Also use user defined functions.
I cant do the part where it says if it is wrong print the same thing again..help me out...
int riwo ( int ,int, int ); //function prototype
int num1, num2, awn;
num1 = 1+ rand () % 10;
num2 = 1+ rand() % 10;
printf ("What is %d times %d: ", num1 , num2);
scanf ("%d", &awn );
if ( riwo(num1, num2,awn) == 1 )
printf ("Very good\n");
else if ( riwo(num1, num2, awn) == 0)
printf ("You are wrong\n");
int riwo (int a, int b, int tot )
if ( tot == a*b )