Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package projekat;
  7.  
  8. import java.util.Random;
  9.  
  10. /**
  11. *
  12. * @author student
  13. */
  14. public class Projekat {
  15.  
  16. /**
  17. * @param args the command line arguments
  18. */
  19. public static void main(String[] args) {
  20.  
  21. int [] niz = new int[100];
  22. int [] parnNiz = new int[100];
  23.  
  24. Random random= new Random();
  25.  
  26.  
  27. for(int i=0; i< niz.length; i++)
  28. {
  29. niz[i] =random.nextInt(500);
  30. if(niz[i] %2 ==0)
  31. {
  32. parniNiz[i] = niz[i];
  33. }
  34. System.out.println(parniNiz[i]);
  35. }
  36.  
  37.  
  38. }
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement