Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
using namespace std;
3.
class BaseClass
4.
{
5.
public:
6.
virtual void myFunction()
7.
{
8.
cout myFunction();
39.
return 0;
40.
}
Options:
A .  123
B .  12
C .  213
D .  321
Answer: Option A

We are passing the objects and executing them in a certain order and we are printing the program flow.
Output:
$ g++ des3.cpp
$ a.out
123



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers