Skip to content

Instantly share code, notes, and snippets.

@andraantariksa
Created February 12, 2019 07:43
Show Gist options
  • Save andraantariksa/d86417bd39242164a594db1c1ff93e0a to your computer and use it in GitHub Desktop.
Save andraantariksa/d86417bd39242164a594db1c1ff93e0a to your computer and use it in GitHub Desktop.
Assignment Structured Programming 1
/*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