Java program to find largest of three numbers

 Java program to find largest of three numbers 

/*write a java program to finds largest of three numbers and then prints it*/
import java.util.Scanner;

class LargestNumber
{
   public static void main(String args[])
   {
      int a, b, c;
      System.out.println("Enter three integers ");
      Scanner in = new Scanner(System.in);

      a = in.nextInt();
      b = in.nextInt();
      c = in.nextInt();

      if ( a > b && a > c )
         System.out.println("'a' is largest.");
      else if ( b > a && b > c )
         System.out.println("'b'  is largest.");
      else if ( c > a && c > b )
         System.out.println("'c'  is largest.");
   }
}
Copyright © C Program | Java | OpenGL Programming | Hadoop at Computaholics