C++ Function Overloading
Submissions: 492   Accuracy:

52.66%

  Difficulty: Basic   Marks: 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


 

** For More Input/Output Examples Use 'Expected Output' option **

Contributor: Vanshika
Author: Vanshika_pec


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.