I've tried to make a bmr calculator as a practice. So far it works perfectly, and i understand everything ive done. I want to put paremeter passing in and have the male bmr function as the calcululation only and have everything else in main. So that means passing age height weight which i sort of get. I think their would be less of it if i did it like that. Ive tried for hours and got no where. Ive put the main and the male function below. If anyone could offer any help I would be incredibly greatful. Thanks :)
In your void malebmr() definition, change bmr to a float data type (you have it as an int right now, but you are using floats in the calculation for it). After you do that, temporarily comment this part of your code like this:
int main()
{
char restart;
int m;
int f;
int q;
float bmr;
int age; //variables that are local to this function
float weight; //Getting age, height and weight
float height;
do //to restart the programme once function is finished
{
Trying to return the value from the malebmr to the main. Trying to cut the original programme down by using parameter passing. It wont accept the parameters in the function....
all you need to do is declare the variable type in your void malebmr function and in your case it is (int , float , float)
and then you declares bmr in wrong place. either you have to make it global and you declare it at the beginning or you declare it in your void function.
please use code tgs when writing codes. it is<>brackets next the window. it is easier to read the code like that.. thanx :)