heimsventus

BMI 1 line correct Ben Thompson

Jan 22nd, 2017
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. // ConsoleApplication1.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include <iostream>
  6. #include <string>
  7. #include <cmath>
  8. using namespace std;
  9. int main()
  10. {
  11.     double weight;
  12.     double height;
  13.     cout << "enter in weight" << endl;
  14.     cin >> weight;
  15.     cout << "enter in height" << "\n";
  16.     cin >> height;
  17.     double bmi = ((weight*.45)/(pow((height*.025), 2)));
  18.     cout << "your bmi is " << bmi << "." << endl;
  19.     system("pause");
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment