Skip to content

Instantly share code, notes, and snippets.

@jonathan-irvin
Created April 16, 2015 19:45
Show Gist options
  • Save jonathan-irvin/72c8f57de189216db792 to your computer and use it in GitHub Desktop.
Save jonathan-irvin/72c8f57de189216db792 to your computer and use it in GitHub Desktop.
Geometric Mean
import java.util.Scanner;
public class geoMean {
public static void main(String[] args) {
System.out.print("Enter number 1: ");
Scanner intInput = new Scanner (System.in);
double number1 = intInput.nextDouble();
System.out.print("Enter number 2: ");
double number2 = intInput.nextDouble();
System.out.println("The geometric mean is "+Math.sqrt(number1 * number2));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment