array random

I am trying to make a five digit random number using an array i cant figure out how to do it can someone help please.


You have to be CLEARLY what you want to do.

just RANDOM NUMBER USING ARRAY, I can't understand what you want array to make random number.
cheers.
Did you ask to generate random numbers to fill the array, or get a random array index number to get that "random" value ?
use a "for" loop.
to be more specific,see this code:
1
2
3
4
5
int random[5];
for(int i=0;i<=5;i++) {
		random[i] = rand();
	    cout << random[i] << " ";
	}

Topic archived. No new replies allowed.