Question: Complete this program, prompting the user to enter two positive numbers a and b so that a is leimport java.util.Scanner; public class TwoNumbers { public
Complete this program, prompting the user to enter two positive numbers a and b so that a is leimport java.util.Scanner;
public class TwoNumbers
public static void mainString args
Scanner in new ScannerSystemin;
int a;
int b;
HINT: Choose an appropriate loop and a loop condition
Your code goes here
System.out.println
"Enter two positive integers, the first smaller than the second.";
a innextInt;
System.out.printlnFirst: a;
b innextInt;
System.out.printlnSecond: b;
Your code goes here
This line should only be printed when the input is correct
System.out.printlnYou entered a and b;
ss than b
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
