This should move to C.
Your scanf was wrong, the pattern meant you never got a value. The output problem was because printf expects a list of arguments to substitute for format placeholders. You put a variable reference in the string. While this style can work in some languages, the printf function in C doesn't do that.
Here's some corrected code:
CODE
/*Filename: week2-pkc.c */
/* This program prompts the user to enter a decimal Fahrenheit temperature to be converted to Celsius */
/*Ask the user to enter a faherinheit temperature to be converted to Celsius */
#include <stdio.h> /*Define data type*/
/*#include <ctype.h> Define data type*/
main() {
float Fahrenheit; /*Variable to hold Fahrenheit*/
float Celsius; /*Variable to hold Celsius*/
printf("Please enter a Faherinheit temperature to be converted to Celsius\n example 82 or 71.5\n");
scanf("%f",&Fahrenheit);
Celsius = (Fahrenheit - 32) * (5.0/9.0); /*Perform calculation to convert fahrenheit to Celsius*/
printf("Fahrenheit = %.2f\nCelsius = %.2f\n", Fahrenheit, Celsius); /*Print out Fahrenheit number given and the Celsius Equivilant*/
printf("Press Enter to exit");
return 0;
}
Hope this helps.