Skip to content

Instantly share code, notes, and snippets.

@Sergaav
Created March 26, 2015 13:41
Show Gist options
  • Save Sergaav/42f1c2ea0cef3aa9cfac to your computer and use it in GitHub Desktop.
Save Sergaav/42f1c2ea0cef3aa9cfac to your computer and use it in GitHub Desktop.
Biggest from 4th
package com.gmail.sergaav.dz3_1;
import java.util.Scanner;
public class dz3_1 {
public static void main(String[] args) {
double a;
double b;
double c;
double d;
Scanner sc = new Scanner (System.in);
System.out.println("Input a:");
a=sc.nextDouble();
System.out.println("Input b:");
b = sc.nextDouble();
System.out.println("Input c:");
c = sc.nextDouble();
System.out.println("Input d:");
d = sc.nextDouble();
if (a<b){
a=b;
if (a<c){
a=c;
if (a<d){
a=d;
}
}
}
System.out.println(a);
sc.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment