Random generator help

hello people, just wondering if anyone can help me to understand why my code doesn't somewhat work which it prints numers outside of range.
I want to print for example user input : 10 min, 20 range in which it prints 10-30
My part of my code:

Int main()
{ int a[7];


}


Void user input(int * ,int a, int b)
{
Cin>>b;
// min
Cin>>a;
//range
For (in t = 0 ; t< 7; I++)
{ a[t]= rand()% (a+b)+b;

Cout << a[t]<<endless;

}

Also I found information here in forum
Ex: v2 = rand() % 100 + 1; // v2 in the range 1 to 100
How come this works
Last edited on
How come this works

This doesn't work. Your code is a bunch of compiler errors.

P.S : Cin and Cout do not exist. Do you mean cin and cout?
Topic archived. No new replies allowed.