Computer Science, asked by AbhayT, 1 year ago

write a program to input two numbers and print the highest using if command.

Answers

Answered by AyaanMubarki
2
//to input two numbers and print the numbers
import java.util.*;
public class Number
{
public static void main(String args[])
{
Scanner in= new Scanner(System.in);
int a,b;
System.out.println(Enter two number);
a=in.nextInt();
b=in.nextInt();
if(a>b)
System.out.println(a+"is greater than"+b);
else(b>a)
System.out.println(b+"is greater than"+a);
}
}
Answered by 27maanvi
2

may be the right answer.....

Attachments:
Similar questions