Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to compare 3 numbers in java

if (a > b && a > c) {
    //Here you determine second biggest, but you know that a is largest
}

if (b > a && b > c) {
    //Here you determine second biggest, but you know that b is largest
}    

if (c > b && c > a) {
    //Here you determine second biggest, but you know that c is largest
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #compare #numbers #java
ADD COMMENT
Topic
Name
5+8 =