Advertisement
heimsventus

else if statements

Jan 25th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.59 KB | None | 0 0
  1. // ConsoleApplication3.cpp : Defines the entry point for the console application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "stdafx.h"
  6. #include <iostream>
  7. #include <string>
  8. #include <cmath>
  9. using namespace std;
  10. int main()
  11. {
  12.  
  13.     int bmi = 25;
  14.     if (bmi < 18.5)
  15.     {
  16.         cout << "You are underweight." << endl;
  17.     }
  18.      else if ( bmi >= 18.5 && bmi<= 24.9 )
  19.     {
  20.         cout << " You are normal weight." << endl;
  21.     }
  22.  
  23.     else if (25 < bmi < 29.9)
  24.     {
  25.         cout << " You are overweight." << endl;
  26.  
  27.     }
  28.     else if (bmi > 30)
  29.     {
  30.         cout << " You are obese." << endl;
  31.     }
  32.  
  33. system("pause");
  34.  
  35. return 0;
  36.  
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement