well....my teacher ask me to create a program that reads set of integer's and then finds and prints the sum of the even and odd integers....could someone help me in dis program...

and can u make it simple plss....ill be happy if u would...

plsss and thank you...:icon_confused:

Comments
Use Relevent title to your thread.

When you say reads do you mean reading from file or just a mistype? I think you mean read from an array. This can be done by checking each number in the array and seeing if they are devisable by 2. If they are then it is even other wise its an odd number.

use the modulus sign to work it out: %

When you say reads do you mean reading from file or just a mistype? I think you mean read from an array. This can be done by checking each number in the array and seeing if they are devisable by 2. If they are then it is even other wise its an odd number.

use the modulus sign to work it out: %

yea....i think ill try that...thnx....

ill let u know if i can do it....

The best tip i have got from my Java lecturer is,
when you have a problem, try to think a non-programming solution first.
for example:
there ia a set of number on a piece of paper, how do you calculate the total of odd numbers and even numbers?
you have to go through each number to check whether it is odd or even first

Edited 7 Years Ago by zhangj5: n/a

This article has been dead for over six months. Start a new discussion instead.