How to find out the begest number between the three number in java
public class
{
public static void main(String args[])
{
int a,b,c;
Scanner sc=new Scanner();
System.out.println("Enter the three number ");
a=sc.nextInt();
b=sc.nextInt();
c=sc.nextInt();
if(a>b&&a>c)
{
System.out.println("The begest number is "+a);
}
else if(b>a&&b>c)
{
System.out.println("The begest number is "+b);
}
else
{
System.out.println("The begest number is "+c);
}
}
}
public class
{
public static void main(String args[])
{
int a,b,c;
Scanner sc=new Scanner();
System.out.println("Enter the three number ");
a=sc.nextInt();
b=sc.nextInt();
c=sc.nextInt();
if(a>b&&a>c)
{
System.out.println("The begest number is "+a);
}
else if(b>a&&b>c)
{
System.out.println("The begest number is "+b);
}
else
{
System.out.println("The begest number is "+c);
}
}
}
No comments:
Post a Comment