write a program to input two numbers and find greater number
write a program to input two numbers and find greater number
Answers
Answered by
6
Answer:
import java.util.*;
class greater
{
public static void main()
{
Scanner sc=new Scanner(System.in);
int max=0,n1,n2;
System.out.println("enter two numbers");
n1=sc.nextInt();
n2=sc.nextInt();
max=Math.max(n1,n2);
System.out.println("greater number is"+max);
}
}
Similar questions