what will be output of this code | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

what will be output of this code

#include<iostream> using namespace std; template<class T> T maximum(T a,T b,T c) { T max=a; if(b>max) { max=b; } if(c>max) { max=c; } return max; } int main() { cout<<maximum(1,4.7,3.9); }

4th Aug 2017, 11:16 AM
Siddharth K
Siddharth K - avatar
1 Answer
+ 5
An error. You are using ints with doubles.
4th Aug 2017, 12:13 PM
J.G.
J.G. - avatar