C++ Function Overloading
Basic Accuracy: 50.06% Submissions: 949 Points: 1

Write a program to overload the function max() to find the maximum of two integers, two characters and two doubles.

Input:
The first line of input contains integer T denoting the number of test cases. For each test case, the first line contains an integer choice i.e if 1 that means integer inputs or if 2 means character inputs and 3 means double type inputs. Next line takes two input, that can be
integers or characters or doubles.

Output:
For each test case, the 
output is the maximum of two inputs.

Constraints:
1<=T<=100
1<=choice<=3

Example:
Input

3
1
100 5
3
50.86 4.95
2
a A
Output:
100
50.86
a


 

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.