Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class HiGame {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- // Create a random number for the user to guess
- int theNumber = (int)(Math.random() * 100 + 1);
- // System.out.println( theNumber );
- int guess = 0;
- System.out.println("Guess a number betweeen 1 and 100:");
- guess = scan.nextInt();
- System.out.println("You entered " + guess + ".");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement