Question: Write a template function T findMax ( const T& a , const T& b ) that takes two parameters of the same type and returns
Write a template function T findMaxconst T& a const T& b that takes two parameters of the
same type and returns the larger of the two. This function should work for any data type that
supports comparison using the operator.
Testing the Function: In your main function, test findMax with different data types:
Call findMax with two integers.
Call findMax with two floatingpoint numbers.
Call findMax with two characters.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
