Sail E0 Webinar
Question


What is the output of this program?



1.
#include
2.
using namespace std;
3.
template
4.
class TestVirt
5.
{
6.
public:
7.
virtual type TestFunct(type Var1)
8.
{
9.
return Var1 * 2;
10.
}
11.
};
12.
int main()
13.
{
14.
TestVirt Var1;
15.
cout

Options:
A .  100
B .  200
C .  50
D .  none of the mentioned
Answer: Option B

In this program, We are using class to pass the value and then we are manipulating it.
Output:
$ g++ ftemp3.cpp
$ a.out
200



Was this answer helpful ?

Submit Solution

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

Latest Videos

Latest Test Papers