Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner keyboard = new Scanner(System.in);
- int rNumber = 3;
- System.out.println("I have chose a number between 1 to 10. Try to guess it...");
- System.out.println("Your Guess: ");
- int entry = keyboard.nextInt();
- while ( entry != rNumber )
- {
- System.out.println("\nThat is incorrect! Guess again.");
- System.out.println("Your guess: ");
- entry = keyboard.nextInt();
- }
- System.out.println("\nThat's right! You're a good guesser");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement