Question
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
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
Answer: Option D
Was this answer helpful ?
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