Hi there
I'm still new to this Programming thing so bear with me:
I'm trying to set a program that reads like this:
-How many cakes did you eat today?
__
-You gained __ lbs.
here are my variables:
5000 Calories = 1 cake
1 lbs = 3500 Calories
heres my setup:
#include<stdio.h>
#define CALORIES_IN_CAKE 5000
#define CALORIES_IN_POUND 3500
int main (void) {
double pounds_in_cake, num_cakes;
pounds_in_cake=(CALORIES_IN_CAKE)/CALORIES_IN_POUND;
printf("How many cakes did you eat today?\n");
scanf("%lf", &num_cakes);
printf("You gained %.2lf pounds.\n",
pounds_in_cake*num_cakes);
system("PAUSE");
return 0;
}
However, my output is wrong.
I cant seem to find the problem
Any response will greatly appreciated