Code DrillsArray
Highest Exam Mark
A teacher has entered the final exam marks for a class of students. Find and print the maximum mark obtained in the class. The number of students is given first, followed by their respective marks.
A teacher has entered the final exam marks for a class of students. Find and print the maximum mark obtained in the class. The number of students is given first, followed by their respective marks.
Input formatLink to this section
- Line 1: An integer N representing the number of students
- Line 2: N space-separated integers representing the marks
Output formatLink to this section
- Line 1: The maximum mark as a single integer
ConstraintsLink to this section
- 1 <= N <= 100
- 0 <= marks <= 100
tip
Initialize the maximum variable with the first element of the array and compare it with the rest.
Rate this content
Sign in to rate
Discussion
Sign in to join the discussion