Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mariiaKolokolova
Created May 3, 2020 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mariiaKolokolova/e31d1aee266fc2c90a52cb84475315bc to your computer and use it in GitHub Desktop.
Save mariiaKolokolova/e31d1aee266fc2c90a52cb84475315bc to your computer and use it in GitHub Desktop.
package maricka.kolokolova;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
int cn = 0;
int[] mas = { 0, 5, 2, 4, 7, 1, 3, 19 };
for (int i = 0; i < mas.length; i++) {
if (mas[i] % 2 != 0) {
cn = cn + 1;
}
}
System.out.println("Count of odd numbers in the string is : " + cn);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment