Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Arreglo {
  3. public static void main(String[] args) {
  4. Scanner teclado = new Scanner (System.in);
  5.  
  6. int[] arr = new int [7];
  7. int i;
  8.  
  9. for (i = 0 ; i < arr.length ; i ++){
  10. System.out.printf(" Ingrese numero [%d]: ", i);
  11. arr[i] = teclado.nextInt();
  12. }
  13.  
  14. for (i = 0 ; i < arr.length ; i ++){
  15. if (arr[i] % 2 == 0){
  16. System.out.printf(" Los numeros pares son [% d] ", i);
  17. }
  18. }
  19. }
  20.  
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement