1. ## counting even numbers

ok... I am very new to C++... I need to write a function that will determine whether or not each number included in an array of random numbers is even, and then return the total amount of even numbers. I'm sure this is very easy, I just can't seem to figure it out... any help would be greatly appreciated!

2. Loop through the array, for every number test if that number modulus 2 is equal to 0, if so then it is even and you increment a variable.

3. how to make the program determine wheter or not the number is even... the program that I am writing asks the user to enter how many random numbers need to be generated, and the part that I am having a problem with is writing a function to count how many of those numbers are even.

4. Originally posted by hk_mp5kpdw
Loop through the array, for every number test if that number modulus 2 is equal to 0, if so then it is even and you increment a variable.
how do I test if "the number modulus 2 is equal to 0" that is the problem I am having

5. Code:
`if( number % 2 == 0 ) iNumEvens++;`

6. thank you... like I said... I am very new to this