i am in a class and find C++ a challenge. i have an assignment and this is what i have so far. i need help, because i am not too analytical.
#include <cstdlib>
#include <ctime>
#include <iostream>
using std::cout;
using std::endl;
int main()
{
int (a, b);
int (a * b ) = result;
int result;
srand( (unsigned)time( NULL ) ); //set seed to sys time
for (int i = 1; i < 2; i++)
{
cout << 1 + rand() % (10 - 1 + 1)<< endl;
cout << 1 + rand() % (10 - 1 + 1)<< endl;//how do i put side beside each other with X's sign
}
return 0;
}
cin >> c
if (int a * int b) = int c
getline int c//do i need this
cout << "" ", is the correct answer."
if c != (int a * int c)
getline int c
cout << "" ", is not the correct answer."
// loop to try again
//option to exit either way
Use rand() to produce two positive one-digit integers.
The program should then output a question using the numbers.
The student then types the answer. The program checks the students answer.
If it is correct, print Very good!, and ask another multiplication question.
If the answer is wrong, print No. Please try again., and let the student
try the same question repeatedly until the student gets it right.
should i use calling or pass by value?