write the output of the following program.
class MAIN
{
public:
MAIN()
{
calculate ();
count<<"\t"<<"own country \n";
}
void calculate ()
{
display();
count<<"\t"<<"mother land";
}
void display()
{
count<<"India is my";
};
void main()
{
MAIN m;
}
Answers
Answered by
1
Try to get it's Execution
Compiler first execute main function
then it goes to calculate function
then in Calculate function first it encounters display function
and execute display function and print
India is my
then it goes back to calculate function
and print
motherland
then it goes back to main function and print
own country
so Finally output is
India is my motherland own country
Similar questions