Here is my code:
Code:
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <stdio.h>
using namespace std;
void myflush(std::istream& in)
{
in.clear();
in.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
}
void mypause()
{
myflush(std::cin);
std::cin.get();
}
int main(void)
{
srand((unsigned)time(0));
int random_integer;
for(int index=0; index<20; index++){
random_integer = (rand()%10)+1;
cout << random_integer << endl;
mypause();
}
}
I want it so this program Outputs 5 Random numbers instead of one number.
so I want 5 Random numbers such as "19, 9, 1, 6, 8" instead of only one Random number.
So. How would I do this?