Skip to content

Commit bfa2ef5

Browse files
authored
Merge pull request #37 from minhaj-313/master
Create BMI_Calculator.java
2 parents 58a0c76 + 2285354 commit bfa2ef5

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Miscellaneous/BMI_Calculator.java

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

0 commit comments

Comments
 (0)