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 main(String[] args)
{
Scanner in = new Scanner(System.in);
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 = in.nextInt();
System.out.println("First: "+ a);
b = in.nextInt();
System.out.println("Second: "+ b);
}/* Your code goes here */
// This line should only be printed when the input is correct
System.out.println("You 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!