Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class BMI {
- public static void main(String[] args) {
- Scanner sss = new Scanner (System.in);
- System.out.println("Enter weight in pounds: ");
- System.out.println("Enter height in inches: ");
- double a1;
- a1 = sss.nextDouble();
- int a2;
- a2 = sss.nextInt();
- double k = (a1*0.45359237); /* weight in kilograms*/
- double m = (a2*0.0254); /* height in meters*/
- double h = (m*m); /* square height */
- System.out.println("BMI is "+ (double) k/h);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement