Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Add Even and Odd Numbers

807605Jul 7 2007 — edited Jul 7 2007
I have a programming assignment that needs to read a set of integers and then finds and prints the sum of the evens and sum of the odds.

I know how to find out which numbers are odd and even, I just can't figure out how to add up the evens and odds. Say a set of 10 integers is inputted, how can they be added up after it is determined if they are even or odd?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 4 2007
Added on Jul 7 2007
35 comments
1,080 views