Hello everyone, this is my first post.
As can be quite rightly guessed, I am new to C++ and struggling with some coursework.
My task is to produce a program that prints out 5000 random numbers between 1-5, also printing out the frequency of each given number.
I have searched for an answer as to how this might be done, and I believe it might have something to do with Arrays, could someone please give me a hint whether this is right?
Here is my code so far
#include <vcl.h>
#include <iostream.h>
using namespace std;
int main(void)
{
int random_integer;
for(int numero=0; numero < 5000; numero++){
random_integer = 0 + int(6 * rand()/(RAND_MAX+1.0));
cout << random_integer << endl;
}
cin.get();
return 0;
}
I realize that it is currently printing out only the random numbers...