write a program to input two numbers and print the highest using if command.
Answers
Answered by
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);
}
}
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
2
may be the right answer.....
Attachments:
Similar questions
Math,
7 months ago
Computer Science,
7 months ago
India Languages,
7 months ago
World Languages,
1 year ago
Business Studies,
1 year ago
Biology,
1 year ago