Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
using namespace std;
3.
template
4.
class Test
5.
{
6.
public:
7.
Test()
8.
{
9.
};
10.
~Test()
11.
{
12.
};
13.
type Funct1(type Var1)
14.
{
15.
return Var1;
16.
}
17.
type Funct2(type Var2)
18.
{
19.
return Var2;
20.
}
21.
};
22.
int main()
23.
{
24.
Test Var1;
25.
Test Var2;
26.
cout
Options:
A .  100
B .  200
C .  3.123
D .  2003.123
Answer: Option D

In this program, We are passing the value and returning it from template.
Output:
$ g++ farg3.cpp
$ a.out
2003.123



Was this answer helpful ?

Submit Solution

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

Latest Videos

Latest Test Papers