Advertisement
cesarnascimento

vetores impar ou par 20

May 16th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.42 KB | None | 0 0
  1.  
  2. public class fsfsfs {
  3.  
  4.     public static void main(String[] args) {
  5.         final int num = 20;
  6.         int []pares = new int[num];
  7.         int []impares = new int[num];
  8.        
  9.         for(int i=0;i<num;i++){
  10.             if(i % 2 == 0){
  11.                 pares[i] = i;
  12.                 System.out.println("Pares: "+i);
  13.             }else{
  14.                 impares[i]=i;
  15.                 System.out.println("Impares: "+i);
  16.             }
  17.         }}
  18.  
  19.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement