Join Regular Classroom : Visit ClassroomTech

Coding Questions | Odd Even Difference | Codewindow.in

Write a program to return the difference in the sum of odd numbers and even numbers from an array of positive integers. Finding the difference between the sum of odd and even numbers from a list of 5 numbers.
Input:
5
10 11 7 12 14

Output:
-18

Example:
The first parameter (5) is the size of the array. Next is an array of integers. The calculation of the difference between the sum of odd and even numbers is as follows:
(10+12+14)-(11+7)
=-18

Solution:

Coming....
You Missed
Also Checkout