fork download
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. double weight;
  7. double height;
  8. cout <<"Enter your weight in pounds :";
  9. cin >> weight;
  10. cout << endl;
  11. cout <<"Enter your height in inches :";
  12. cin >> height;
  13. cout << endl;
  14. cout <<"Weight is given by " << weight << endl;
  15. cout <<"Height is given by " << height << endl;
  16. double bmi = ( weight * 703 ) / ( height * height );
  17. if (bmi < 18.5)
  18. cout << " Underweight " << endl;
  19. else if(bmi < 25)
  20. cout << " Normal " << endl;
  21. else if(bmi < 30)
  22. cout << " Overweight " << endl;
  23. else
  24. cout << " Obese " << endl;
  25. return 0;
  26. }
Success #stdin #stdout 0s 3476KB
stdin
120
66
stdout
Enter your weight in pounds :
Enter your height in inches :
Weight is given by 120
Height is given by 66
 Normal