Find Largest Number Between Two Numbers From User Input

Find Largest Number Between Two Numbers From User Input 

import java.util.Scanner;
public class Fromtwo
{
    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);
    }
}


Share this

Related Posts

Previous
Next Post »

Recent