//Minimum and maximum between 2 nos
import java.util.Scanner;
class Min_Max {
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter 2 nos:");
int a=sc.nextInt();
int b=sc.nextInt();
if(a==b)
System.out.println("Both are equal.");
else if(a>b)
System.out.println("Max="+a+" Min="+b);
else
System.out.println("Max="+b+" Min="+a);
}
}
import java.util.Scanner;
class Min_Max {
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter 2 nos:");
int a=sc.nextInt();
int b=sc.nextInt();
if(a==b)
System.out.println("Both are equal.");
else if(a>b)
System.out.println("Max="+a+" Min="+b);
else
System.out.println("Max="+b+" Min="+a);
}
}
No comments:
Post a Comment