Skip to content

Instantly share code, notes, and snippets.

@saiema
Created March 7, 2018 15:42
Show Gist options
  • Save saiema/8f473da043635c69b18c8246f4f3f6d0 to your computer and use it in GitHub Desktop.
Save saiema/8f473da043635c69b18c8246f4f3f6d0 to your computer and use it in GitHub Desktop.
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