Computer Science, asked by priyanshijainjain661, 5 months ago

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 nisha263248
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