Largest Element in Array
Submissions: 7080   Accuracy:

49.97%

  Difficulty: School   Marks: 0
*School Problem's Submission isn't counted in score!

Given an array a[] of size N. The task is to find the largest element in it.

Input:
The first line of input contains an integer T, denoting the number of testcases. Then T test cases follow. Each test case contains an integer N , the number of elements in the array. Then next line contains N integers of the array separated by space.

Output:
Print the maximum element in the array.

Constraints:
1 <= T <= 100
1 <= N <= 100
1 <= a[i] <= 103

Example:
Input:

2
5
10 324 45 90 9808
7
1 2 0 3 2 4 5

Output:
9808
5

Explanation:
Testcase 1:
The largest element of given array is: 9808.

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

Contributor: Ayush Govil
Author: Ayush Govil 1


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.