Created
March 7, 2018 15:42
-
-
Save saiema/8f473da043635c69b18c8246f4f3f6d0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class FindEvenNumbers { | |
public static int countEvens(int[] values) { | |
int count = 0; | |
for (int i = 0; i < values.length; i++) { | |
int value = values[i]; | |
if (value % 2 != 0) { | |
count = count + 1; | |
} | |
} | |
return count; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment