Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

3rd Edition

978-1119907466

More Books

Students also viewed these Databases questions