How does random and randomize functions work?
Please help me!
What are the different outputs that can be predicted from this program? And How? Explain.
#include<iostream.h>
#include<stdlib.h>
void main()
{ randomize()
int Game[] = {10,16},P; //what does this mean?
int Turn = random(2) + 5;
for(int T = 0; T<2; T++)
{ P = random(2);
cout<<Game[P] + Turn <<"#";
}
}
I got the output of this program, but how the output was generated, I have no Idea. Please help. ASAP.