I am trying to write a program that can be used to display two random numbers to be added together. This program should wait for the answer to be input. If the answer is correct display a statement that says that is correct. If the answer is wrong it needs to display that is incorrect then display the correct answer.
Thanks.
Here is what I have so far. I can not figure how the display part to display the statements and the correct answer if need be. Go easy I am new at this and it is my first attempt at programming
#include <iostream>
#include <cstdlib>
#include <iomanip>
#include <ctime>
using namespace std;
int main ()
{
srand((unsigned)time(0));
int random_integer1;
int random_integer2;
double answer;
random_integer1 = (rand()%500)+1;
random_integer2 = (rand()%500)+1;
cout << setw (6) << random_integer1 << endl;
cout << "+ ";
cout << setw (4) << random_integer2 << endl;
cout << "------";
cout << "\n";
cin >> answer;
cout << "\n";
return 0;
}