include<iostream.h> #include<stdlib.h> #include<conio.h> void main() { clrscr(); //char serial[]="EXAMS"; //int number[]={69,66,67,68}; randomize(); char planets[][10]={"Mercury","Venus","earth","Mars"}; //cout<<number[random(1)]; for(int i=0;i<4;i++) cout<<"::"<<planets[sizeof(char)+random(3)-1]; getch(); } How to calculate the output for it.
Options:
1::venus::mercury::mars::earth
2::earth::mercury::venus::earth::
3::mercury::earth::mercury::earth
4::mars::mercury::venus::earth