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 scanner = new Scanner(System.in);
- System.out.println("Enter a number: ");
- int value = scanner.nextInt();
- while(value !=5){
- System.out.println("Enter a first number: " );
- value= scanner.nextInt();
- }
- System.out.println("Got 5!");
- int value2 = 0;
- do {
- System.out.println("Enter a second number: " );
- value2= scanner.nextInt();
- }
- while (value2 !=6);
- System.out.println("Got 6!");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment