C:\Users\KILL\Downloads\bmi.cpp|7|error: expected unqualified-id before 'return'|
C:\Users\KILL\Downloads\bmi.cpp|11|error: expected constructor, destructor, or type conversion before '<<' token|
C:\Users\KILL\Downloads\bmi.cpp||In function 'int main()':|
C:\Users\KILL\Downloads\bmi.cpp|27|error: 'BMI1' was not declared in this scope|
C:\Users\KILL\Downloads\bmi.cpp|28|error: 'BMI2' was not declared in this scope|
||=== Build finished: 4 errors, 0 warnings ===|
Your code for your functions are not in a function body:
1 2 3 4
double getBMI (int h, int w, double s); // <- this is just a prototype
return (w/(h*h)); // <- this is code existing outside of any function.
// That will give you an error.
You need to give bodies to your function. Do this by getting rid of the semicolon and putting the code body in braces. Just like you do for main():
1 2 3 4
double getBMI (int h, int w, double s) // <- no semicolon
{ // <- a brace indicating this code is the function body
return (w/(h*h)); // <- this is now part of the getBMI function body
} // <- getBMI function ends here
You have a similar problem with your 'output' function