Addition, Subtraction and Multiplication
The program can be used as a math tutor for a young student. The program should display two random numbers between 1 and 9. After the student has entered an answer, the program should display the correct answer so the student can see if his/her answer is correct.
1
Expert's answer
2012-12-20T07:54:44-0500
#include <iostream> #include <cstdlib> #include <time.h> using namespace std;
int main() {
srand ( time(NULL) ); int i,j;
i=rand()%9; j=rand()%9; int m=i*j;
cout<<"please ask the question"<<j<<"*"<<i<<"=?"<<endl; int k; cin>>k;
Comments
Leave a comment