Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 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. /**
  18. * @param args the command line arguments
  19. */
  20. public static void main(String[] args)
  21. {
  22. Random rand = new Random();
  23. int[] niz = new int[100];
  24. int[] niz1 = new int[100];
  25.  
  26. for (int i = 0; i < 100; i++)
  27. {
  28. niz[i] = rand.nextInt(500);
  29.  
  30. if (niz[i] % 2 == 0)
  31. {
  32. niz1[i] = niz[i];
  33. }
  34. }
  35.  
  36. for (int i = 0; i < 100; i++)
  37. {
  38. System.out.println(niz[i]);
  39. System.out.println(niz1[i]);
  40. }
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement