Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- float bmi(float, float);
- int main(){
- float weight;
- float height;
- std::cout << "Input your weight(In pounds)" << std::endl;
- std::cin >> weight;
- std::cout << "Input your height(In inches)" << std::endl;
- std::cin >> height;
- bmi(weight, height);
- return 0;
- }
- float bmi(float n1,float n2){
- float bmin;
- bmin = (n1*703)/(n2*n2);
- std::cout << "Your BMI is: " << bmin << std::endl;
- if(bmin <= 18.49){
- std::cout << "You are underweight!" << std::endl;
- }
- else if(bmin >=18.5 and <= 25){
- std::cout << "You have normal weight!" << std::endl;
- }
- else if(bmin >=25.01 and <=29.99){
- std::cout << "You are overweight." << std::endl;
- }
- else if (bmin >=30){
- std::cout << "You are obese..."
- }
- }
- C:UsersFinneganDesktopComputer Science 3-4Computer Sciencefm2-
- 2.cpp|23|error: expected primary-expression before '<=' token|
- C:UsersFinneganDesktopComputer Science 3-4Computer Sciencefm2-
- 2.cpp|31|error: expected ';' before '}' token|
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement