Remember to checkout the Codesnip below to review the C++ code yourself! Feel free to copy the code, but I ask that you please provide credit if you leave the code unchanged when you use it.
//Programmer: Nazmus //Program: Random Number //Website: EasyProgramming.net #include <iostream> #include <ctime> #include <cstdlib> using namespace std; int main() { int max, random_number, i; for(i=1;i<=5;i=i+1){ cout << "Please input max integer: "; cin >> max; srand(time(0)); random_number = (rand () % max) + 1; cout << random_number << endl; } system("pause"); }