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

Welcome back. I see posts from 6 years ago but your new post is badly formed and unclear.

What @rproffitt said. Put your code inside a code block and then make sure it is properly formatted, indented, etc. Then we can comment more appropriately.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.