Problem Statement 1

Write a program that accepts a set of numbers from the user, stores the values in an array, and finds the maximum and minimum values in the array. 

Suppose the size of the array is n, you have to get n number of values from the user and find the minimum and maximum value.

SAMPLE INPUT

Number of values: 5

Enter values:

25 122 2 56 23

SAMPLE OUTPUT

Maximum value: 122

Minimum value: 2

Sample Program:

Sample Output:

Enter the n values:
5
Enter the elements in the array:
4
8
12
56
1
Maximum value: 56
Minimum value: 1

Any queries leave a comment please and thanks for reading this post.

Leave a Reply

Your email address will not be published. Required fields are marked *