PrintSmallest - int a = input.nextInt...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
import java.util.Scanner; public class PrintSmallest { // a class to prompt the user // to enter two integers // and print the smallest / public static void main(String[]args) { p Scanner input=new Scanner(; System.out.println("Enter a number");
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: int a = input.nextInt(); System.out.println("Enter a different number:"); int b = input.nextInt(); int min =(a<b)?a:b; System.out.println("The smallest of the entered numbers is:"+min); S } }...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online