-
What is the output of this program?
#include <iostream>
using namespace std;
template <class T7gt;
T Maximum(T& p, T& q)
{
return (p > q ? p : q);
}
int main ()
{
int k = 6, L = 9, S;
long Lon = 12, a = 13, b;
S = Maximum(k, L);
b = Maximum(Lon, a);
cout << S << endl;
cout << b << endl;
return 0;
}
-
- 6
9 - 12
13 - 9
13 - 13
9 - None of these
- 6
Correct Option: D
In this program, We are using the ternary operator on the template function.