Ok, so I am literally brand new to writing code. -- Never wrote a line in my life. I'm now in a Computing Fundamentals class at my university - I decided to throw myself in to it. So anyhow, without my blubbering, I'll get to my point.
I have this program a buddy and I wrote last night. We had it working at a time, but changed some stuff here and there. I'm assuming the conversion is simply written wrong, but maybe I'm just totally wrong.
Any ideas on what's going on here? Anything at all is greatly appreciated. I'm so glad this community exists.
I'm probably going to have weekly issues in this class, but it's something I know I wanna try.
Any temp. entered 40 or below returns a Celsius of 0. Anything above returns 1075052544 or some such number. I'm stumped. -- Thanks to anyone who at least read this!
I have this program a buddy and I wrote last night. We had it working at a time, but changed some stuff here and there. I'm assuming the conversion is simply written wrong, but maybe I'm just totally wrong.
int main(void)
{
// state variables
int F;
double C;
// input - temperature F
printf("Welcome.\n");
printf("Enter a temperature in degrees Fahrenheit:", F);
scanf("%d" ,&F);
// convert the temperature to celsius
C = ((F - 32) /9) * 5;
// output - temperature F and C
printf("Below is the conversion from Fahrenheit to Celsius.\n");
printf("Degrees F: %d.\n", F);
printf("Degrees C: %d.", C);
return 0;
}
Any ideas on what's going on here? Anything at all is greatly appreciated. I'm so glad this community exists.
Any temp. entered 40 or below returns a Celsius of 0. Anything above returns 1075052544 or some such number. I'm stumped. -- Thanks to anyone who at least read this!