Largest Even in java
Task - For this challenge, you will be given an array and you are asked to find the largest even number and print it to the STDOUT.
Input Format -
you will be taking a number as an input from STDIN which tells about the length of the array. On another line, array elements should be there with single space between them.
Output Format -
print the largest even number to the STDOUT.
Sample Test Case:
Sample Input:-6
78 92 44 63 71 97
Sample Output -
92
Explanation:
In the given array, 78, 92 and 44 are the even numbers and we need to find the largest even number which is 92.
Input Format -
you will be taking a number as an input from STDIN which tells about the length of the array. On another line, array elements should be there with single space between them.
Output Format -
print the largest even number to the STDOUT.
Sample Test Case:
Sample Input:-6
78 92 44 63 71 97
Sample Output -
92
Explanation:
In the given array, 78, 92 and 44 are the even numbers and we need to find the largest even number which is 92.
Comments
Post a Comment