Java Program for Largest Number

This Java program will give you the largest number from given three numbers…

class Max1
{
public static void main (String args[])
{
int a,b,c;
a=10;
b=20;
c=30;
if(a>b && a>c)
System.out.println(“a is max” + a);
elseif(b>a && b>c)
System.out.println(“b is max” + b);
else
System.out.println(“c is max”);
}
}

Program is tested and it gives correct answer.

Add Comment