csea2020pb004 Max and min of an array using functions
Submit solution
C
Points:
10
Time limit:
2.0s
Memory limit:
12M
Authors:
Problem type
Allowed languages
Problem Description
Write a 'C' program using two functions that takes an array of 'n' elements and return the largest and smallest element in the array.
Input Format
The first line of input contains the number of elements in the array and the second line contains the array elements separated by commas.
Output Format
The output must display the largest element and the smallest element in the array on two separate lines.
Sample Input
3
-5,40,1
Sample Output
The largest element in the array is 40
The smallest element in the array is -5
Comments