Skip to content

Commit c2a826c

Browse files
Create BMI.java
1 parent 98534c6 commit c2a826c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

BMI.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import java.util.Scanner;
2+
public class Example {
3+
public static void main(String args[]) {
4+
Scanner sc = new Scanner(System.in);
5+
System.out.print("Input weight in kilogram: ");
6+
double weight = sc.nextDouble();
7+
System.out.print("
8+
Input height in meters: ");
9+
double height = sc.nextDouble();
10+
double BMI = weight / (height * height);
11+
System.out.print("
12+
The Body Mass Index (BMI) is " + BMI + " kg/m2");
13+
}
14+
}

0 commit comments

Comments
 (0)