Advertisement
yanivtamari

29.05(1)

May 29th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.48 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.  
  5.     public static void main(String[] args) {
  6.         Scanner s = new Scanner(System.in);
  7.         int[] evennem = new int[10];
  8.         System.out.printf("please enter %d numbers ", evennem.length);
  9.         for (int i = 0; i < evennem.length; i += 1)
  10.             evennem[i] = s.nextInt();
  11.         System.out.println("the even numbers is: ");
  12.         for (int n:evennem)
  13.             System.out.printf(n%2==0?"%d ":"",n);
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement