Question: What is output? #include using namespace std; template MyType f ( MyType var 1 , MyType var 2 ) { if ( var 1 >

What is output?
#include
using namespace std;
template
MyType f(MyType var1, MyType var2){
if (var1> var2){
return var1;
}
else {
return var2;
}
}
int main(){
cout << f(3,7)<<'';
cout << f('A','B')<<'';
cout << f(3.3,3.4)<<'';
}
7 B 3.4
7'A'3.4
Error: The compiler generates an error in all the cout statements because the data type is not specified.
7 A 3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!