Write a function that takes an array of integers as an argument and returns a value based on the sums of the even and odd numbers in the array.

Write a function that takes an array of integers as an argument and returns a value based on the sums of the even and odd numbers in the array. Let X = the sum of the odd numbers in the array and let Y = the sum of the even numbers. The function should return X – Y


 

See also: Create a calculator application in Java that accepts a mathematical problem via JOptionPane and displays the result using JOptionPane

About the Author: Eric K

Kenyan Developer and Blogger with Interests in Java,Javascript,Node.js, Wordpress, Android, PHP and Making Money Online. Solving world problems through programming is my passion. Hire me: Email : kawi3462@gmail.com