Java Armstrong NumberJava Average of N NumbersJava Biggest of Three NumbersJava Common DivisorsJava Composite NumberJava Condense a NumberJava Even NumberJava Factorial of a NumberJava Fibonacci SeriesJava GCDJava LCMJava Leap YearJava Multiplication TableJava Number CombinationJava Odd NumberJava Palindrome NumberJava Perfect NumberJava Prime FactorJava Prime NumberJava Sum of DigitsJava Swapping Two Numbers

Java Array ProgramsJava Converter ProgramsJava Star Patterns ProgramJava Number Patterns ProgramJava Alphabet Patterns ProgramIn the following example, we will find which of the following numbers (40, 25, 7) is the biggest number.

Java Compiler

public class myClass
{
public static void main(String[] args)
{
int a = 40;
int b = 25;
int c = 7;
System.out.format("The numbers are a = %d, b = %d, c = %d",a, b, c);
if((a > b) && (a > c))
System.out.format("\na = %d is the biggest number", a);
else if(b > c)
System.out.format("\nb = %d is the biggest number", b);
else
System.out.format("\nc = %d is the biggest number", c);
}
}

In the following example, we will find the biggest of any given three numbers.

Java Compiler

import java.util.Scanner;
public class myClass
{
public static void main(String[] args)
{
Scanner reader = new Scanner(System.in);
int a, b, c;
System.out.print("Enter an integer for a = ");
a = reader.nextInt();
System.out.print("Enter an integer for b = ");
b = reader.nextInt();
System.out.print("Enter an integer for c = ");
c = reader.nextInt();
if((a > b) && (a > c))
System.out.format("\na = %d is the biggest number", a);
else if(b > c)
System.out.format("\nb = %d is the biggest number", b);
else
System.out.format("\nc = %d is the biggest number", c);
}
}

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.