Created
February 12, 2019 07:43
-
-
Save andraantariksa/d86417bd39242164a594db1c1ff93e0a to your computer and use it in GitHub Desktop.
Assignment Structured Programming 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*input | |
175 | |
70 | |
*/ | |
#include <iostream> | |
int main(int argc, char const *argv[]){ | |
float height, weight; | |
std::cout<<"Your height (in centimeters): "; | |
std::cin>>height; | |
//std::cout<<std::endl; | |
std::cout<<"Your weight (in kilograms): "; | |
std::cin>>weight; | |
//std::cout<<std::endl; | |
if(weight < height/2.5){ | |
std::cout<<"You're underweight"<<std::endl; | |
}else if(height/2.5 <= weight && weight <= height/2.3){ | |
std::cout<<"Your weight and height are normal"<<std::endl; | |
}else if(height/2.3 < weight){ | |
std::cout<<"You're overweight"<<std::endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment