Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Random;
- public class Main {
- public static void main(String[] args) {
- Random rand = new Random();
- int[] a1 = new int[10];
- int[] a2 = new int[10];
- int min = 1;
- int max = 100;
- System.out.print("Array 1: ");
- for(int x = 0; x< a1.length; x++){
- a1[x] = rand.nextInt(max-min + 1) + min;
- a1[9] = -7;
- System.out.print(a1[x] + " ");
- }
- System.out.println(" ");
- System.out.print("Array 2: ");
- for(int y = 0; y< a2.length; y++){
- a2[y] = rand.nextInt(max-min + 1) + min;
- System.out.print(a2[y] + " ");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement