1. 99
2. 94
3. 96
4. NONE
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;
}
-
UP 0 DOWN 0 0 2
2 Answers
sriraghav
·2009-03-23 08:10:30
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??