Examveda

What will be the output of the following C++ code?
#include <iostream>
using namespace std;
template<typename type> 
class Test
{
    public:
    Test()
    {
    };
    ~Test()
    {
    };
    type Funct1(type Var1)
    {
        return Var1;
    }
    type Funct2(type Var2)
    {
        return Var2;
    }
};
int main()
{
    Test<int> Var1;
    Test<float> Var2;
    cout << Var1.Funct1(200) << endl;
    cout << Var2.Funct2(3.123) << endl;
    return 0;
}

A. 200
3.123

B. 3.123
200

C. 200

D. 3.123

Answer: Option A


Join The Discussion

Related Questions on C plus plus miscellaneous

What is the difference between '++i' and 'i++' in C++?

A. None of the above

B. They both have the same effect

C. '++i' increments the value of 'i' before returning it, while 'i++' increments the value of 'i' after returning it

D. '++i' increments the value of 'i' after returning it, while 'i++' increments the value of 'i' before returning it