War Between Even And Odd in Java

You will be given an array and you need to find odd numbers and add them, find even numbers and add them. Then compare the result, if the sum of even numbers found to be greater then print 'Even' to the output, if sum of odd number is greater than print 'odd' to the output. If sum of both found to be equal, then print 'Tied' to the output.

Input
9
74 32 31 91 77 88 96 44 23
Output:
Even

Input:
5
2 3 4 9 6

Output:
Tied

Comments

Popular posts from this blog

Reasoning-Number Series

Reasoning-Letter Series

Multiply Negative numbers in java