How to find lowest number using if-else

//How to find lowest number using if-else



import java.util.*;
public class M
{
public static void main(String args[])
{
int a,b;
Scanner scan=new Scanner(System.in);
System.out.println("Enter the value of a:");
a=scan.nextInt();
System.out.println("Enter the value of b:");
b=scan.nextInt();

if(a<b)
{
System.out.println("a is less than b");
}
else
{
System.out.println("b is less than a");
}
}
}


OUTPUT:
Enter the value of a:
23
Enter the value of b:
56
a is less than b

No comments:

Post a Comment