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