Write a java program to print two integers and also print greater of two integers
Answers
Answered by
2
Answer:
Explanation:
/* Java Program Example - Find Largest of Two Numbers */
import java.util.Scanner;
public class JavaProgram
{
public static void main(String args[])
{
int a, b, big;
Scanner scan = new Scanner(System.in);
System.out.print("Enter Two Number : ");
a = scan.nextInt();
b = scan.nextInt();
if(a>b)
{
big = a;
}
else
{
big = b;
}
System.out.print("Largest of Two Number is " +big);
}
}
Similar questions