Solved What is wrong with this?

August 29, 2014 at 20:50:05
Specs: Windows 7
It's C and the answer keeps coming 2686740


//included libraries
#include <stdio.h>
int main()
{
int lbs;
int in;
float bmi;
//Ask user weight
printf("Enter your weight in lbs\n");
//Read weight
scanf(" %d", &lbs);

//Ask user height in inches
printf("Enter your height in inches\n", bmi);
//Read height
scanf(" %d", &in);

//Calculate bmi
bmi = (lbs / (in * in);

//Tell user bmi
printf("Your bmi is %.2d",&bmi);
return 0;
}


See More: What is wrong with this?

Report •


#1
August 29, 2014 at 21:11:25
Oh good grief. Really???

Details, details and more details.

Don't forget to preorder your Hatch green chili for this fall. Many vendors ship world-wide.


Report •

#2
August 29, 2014 at 21:23:12
Body Mass Index (or something like that) Probably programing a kiosk for a local gym or chain.
Need more details.
Should have posted under Software/Programing.

You have to be a little bit crazy to keep you from going insane.


Report •

#3
August 29, 2014 at 22:25:43
✔ Best Answer
printf("Enter your height in inches\n", bmi);
You're corrupting your stack. Don't do that.

How To Ask Questions The Smart Way


Report •

Related Solutions

#4
August 30, 2014 at 15:21:18
I'm attempting to make a bmi calculator in C.
It runs fine, but the answer keeps coming to 2686740. Can someone show me what it should like or where I went wrong

Report •

#5
August 30, 2014 at 16:19:32
I did. You just ignored me.

How To Ask Questions The Smart Way


Report •

Ask Question