Skip to content

Commit

Permalink
Create BMI.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Prakhar-Shankar authored Oct 25, 2023
1 parent 98534c6 commit c2a826c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions BMI.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import java.util.Scanner;
public class Example {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
System.out.print("Input weight in kilogram: ");
double weight = sc.nextDouble();
System.out.print("
Input height in meters: ");
double height = sc.nextDouble();
double BMI = weight / (height * height);
System.out.print("
The Body Mass Index (BMI) is " + BMI + " kg/m2");
}
}

0 comments on commit c2a826c

Please sign in to comment.