URGENT!!

pls tell me how randomize() works
Ex..
#include<stdlib.h>
#include<iostream.h>
void main()
{
randomize();
int m[]={99,92,94,96,93,95}, M;
M=m[1+random(2)];
cout<<M;
}

2 Answers

1
sriraghav ·

1. 99
2. 94
3. 96
4. NONE

1
sriraghav ·

Pls tell whether my reason is correct!
Random(2)- will return either return 0,1,2(doubt1-is 2 included)

So possible values inside[] are 1,2,3
so the possibilities are 99,92,94..
Which is correct??

Your Answer

Close [X]