Advertisement
lol1234561

Untitled

Sep 28th, 2023
674
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1. import java.util.Arrays;
  2. import java.util.Random;
  3. public class Main {
  4.     public static void main(String[] args) {
  5.         Random rand =  new Random();
  6.  
  7.         int[] num = new int[10];
  8.  
  9.         System.out.print("Array 1: ");
  10.  
  11.         for( int x = 0; x < num.length; x++){
  12.             num[x] = rand.nextInt(100)+1;
  13.             num[9] = -7;
  14.             System.out.print( num[x] + " ");
  15.  
  16.         }
  17.         System.out.println(" ");
  18.         System.out.print("Array 2: ");
  19.         for( int x = 0; x < num.length; x++){
  20.            num[9] = rand.nextInt(100)+1;
  21.             System.out.print( num[x] + " ");
  22.  
  23.         }
  24.  
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement