I am trying to create a program to help people learn multiplication, and ask a question like, "What is 6 times 7?". I need a function to get random numbers, one to do the multiplitcation, and one to compare the answer from the user with the computer generated one. I'm having some trouble figuring it out... I've got some stuff down, basically just ideas. I'm pretty sure I'm way off, but could somebody just give me an idea of where to go with this?
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <time.h>
int random();
int multiplication (int number1, number2);
int compare (int number1, number1, answer);
int main ()
{
int number1, number1;
clrscr();
srand(time(NULL))
printf("How much is %d times %d?", rand ()%10, rand ()%10,);
scanf("%d, %d", &number1, &number2);
return number1, number2;
}
int multiplication (int number1, number2)
{
int answer;
scanf ("%d", &answer);
return answer;
}
int compare (int number1, number2, answer)
{
int correct;
correct = number 1 * number2
if correct == answer
printf("Very good.");
else
printf("No, please try again.);
}



LinkBack URL
About LinkBacks


