heimsventus

Dailies 2 # 3 BMI one line calc ben thompson

Jan 22nd, 2017
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. // ConsoleApplication3.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.     double bmi = ((weight*.45) / (pow((height*.025), 2)));
  14.         cout << "enter in weight" << endl;
  15.         cin >> weight;
  16.         cout << "enter in height" << "\n";
  17.         cin >> height;
  18.         cout << "your bmi is " << bmi << "." << endl;
  19.         system("pause");
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment