Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Shavit Borisov
- // CW
- import java.util.Scanner;
- import java.util.Random;
- public class RandomMultiplication {
- public static void main(String[] args)
- {
- Scanner in = new Scanner (System.in);
- Random r = new Random ();
- System.out.println("Enter a number:");
- int N = in.nextInt();
- int FirstRandom = 1 + r.nextInt(N);
- int SecondRandom = 1 + r.nextInt(N);
- System.out.println("The multiplication is: " + FirstRandom + " X " + SecondRandom + " = " + FirstRandom * SecondRandom);
- in.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment