Answer:
The C++ code is given below with appropriate comments
Step-by-step explanation:
//Use stdafx.h for visual studio.
#include "stdafx.h"
#include <iostream>
//Enable use of rand()
#include <cstdlib>
//Enable use of time()
#include <ctime>
using namespace std;
int main()
{
//Note that same variable cannot be defined to two
//different type in c++
//Thus, use either one of the two statement
//int seedVal=0;time_t seedVal;
//int seedVal=0;
time_t seedVal;
seedVal = time(0);
srand(seedVal);
//Use rand to generate two number by setting range
// between 0 and 9. Use endl for newline.
cout << (0 + rand() % ((10 - 0) + 0)) << endl;
cout << (0 + rand() % ((10 - 0) + 0)) << endl;
//Use for visual studio.
system("pause");
return 0;
}