Skip to content

Instantly share code, notes, and snippets.

@Hafiz-SE
Created July 29, 2020 21:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hafiz-SE/2e1ab25103209d70006a9c09e60d8915 to your computer and use it in GitHub Desktop.
Save Hafiz-SE/2e1ab25103209d70006a9c09e60d8915 to your computer and use it in GitHub Desktop.
import java.util.Scanner;
class MyClass {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println ("Please Enter First Value : ");
int a = in.nextInt();
System.out.println ("Please Enter Second Value : ");
int b = in.nextInt();
System.out.println ("Please Enter Third Value : ");
int c = in.nextInt();
if (a<b) {
if (c<b) {
System.out.println("Second value is the greatest.");
} else {
System.out.println("Third value is the greatest.");
}
} else {
if (a<c) {
System.out.println("Third value is the greatest.");
} else {
System.out.println("First value is the greatest.");
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment