Search
 
SCRIPT & CODE EXAMPLE
 

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
}
Comment

PREVIOUS NEXT
Code Example
Java :: java randint 
Java :: print hashtable in java 
Java :: java par o impar 
Java :: how to stop timer in java 
Java :: java actionlistener 
Java :: java public static void main 
Java :: java sha256 hex digest 
Java :: how to refresh activity without intent in android 
Java :: add extension quarkus 
Java :: java string contains number 
Java :: how to change top of window in java 
Java :: swing event enter key 
Java :: string starts with alphabet java 
Java :: gradle require java version 
Java :: play sound on button click android studio 
Java :: decomposer chaine de caractère java 
Java :: android send parameters with intent 
Java :: greatest common divisor java 
Java :: java discord bot get id of message it just sent 
Java :: round off java 2 decimal places 
Java :: char cannot be converted to string 
Java :: calculate mean from arraylist jaca 
Java :: json date format for localdate java 
Java :: check array is sorted java 
Java :: how to set title in center in toolbar in android 
Java :: java suppress warnings rawtypes 
Java :: char default value in java 
Java :: lombok gradle dependency spring boot 
Java :: java string to double 
Java :: Calculator Program in Java. 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =