Advertisement
Guest User

Untitled

a guest
Oct 15th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.53 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Lesson3 {
  3.     public static void main(String[] args) {
  4.         System.out.println("Input min number");
  5.         Scanner scan = new Scanner(System.in);
  6.         int x = scan.nextInt();
  7.         System.out.println("Min number is: " + x);
  8.         System.out.println("Input max number : ");
  9.         int y = scan.nextInt();
  10.         System.out.println("Max number is : " + y);
  11.         int random = (int) Math.random() * y + x;
  12.         System.out.println("Your random number is: " + random);
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement