Menu

Smallest of two numbers : Java Program

import java.util.*;
class Display_min_2{
public static void main(String args[]){

Scanner sc= new Scanner(System.in);
System.out.println("please enter two numbers");
int n1= sc.nextInt();
int n2= sc.nextInt();

if(n1>n2)
System.out.println("The smallest number is "+n2);
else
System.out.println("The smallest number is "+n1);


}}