Saturday, February 9, 2019

Min Max Example

Q. Given a list of numbers, find maximum and minimum in this list.

Input Format:

The first line contains numbers separated by a space.

Output Format:

Print maximum and minimum separated by a space.

Example:

Input:
1 2 3 4 5
Output:
5 1

Solution:


Output:

Enter numbers separated by spaces:
5 3 8 0 67 23 6
The minimum and maximum numbers are:
0 67


.

No comments: