Write a program that can be used as Math tutor for a young students. The program should display two random numbers.
To be added such as 247 +129 The program should then pause while the student works on the problem. When the student is ready to check the answer, he or she can press a key and the program will display the correct solution. 247 +129 376
(Hint: use C++ random number generating function for random number generation)
Coding :
#include <iostream>using namespace std;int main(){int number_1;int number_2;int result;cout << "Enter number 1";cin >> number_1;cout << "Enter number 2";cin >> number_2;cout << "result";cin >> result;cout << "number_1+number_2";if (result == number_1 + number_2 ){cout << "your answer is correct";}else{cout << "your answer is incorrect";}return 0;}
Output :
Enter number 1 247
Enter number 2 129
result 376
0 Comments