-
What is the output of this program?
#include <iostream>
using namespace std;
template <typename T, typename U>
void squareAndPrint(T p, U q)
{
cout << p << p * p << endl;
cout << q << " " << q * q << endl;
};
int main()
{
int kk = 3;
float LL = 3.12;
squareAndPrint<int, float>(kk, LL);
}
-
- 39
3.12 9.7344 - 3.12
9.7344 39 - 3.12 9.7344
39 - Compilation Error
- None of these
- 39
Correct Option: A
In this multiple templated types, We are passing two values of different types and producing the result.