Guest User

Untitled

a guest
Dec 17th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. package com.gmail.sergiopartner;
  2.  
  3. import java.util.Arrays;
  4.  
  5. public class Main {
  6.  
  7. public static void main(String[] args) {
  8. int[] a = { 0, 2, 5, 4, 7, 1, 3, 19 };
  9.  
  10. int b = 0;
  11. for (int i = 0; i < a.length; i += 1) {
  12. if (a[i] % 2 != 0) {
  13. b += 1;
  14. }
  15.  
  16. }
  17. System.out.println("Number of non-pair numbers in array " + Arrays.toString(a) + " = " + b);
  18.  
  19. }
  20.  
  21. }
Add Comment
Please, Sign In to add comment