I’m trying to convert temperature given in Fahrenheit to Celsius. But for some reason its not working properly. I know that a similar question has been asked but my problem is different because I can’t even printout what I have scanned (using scanf) from the user.
Code:
#include<stdio.h>
#include<conio.h>
void main()
{
float Fahrenheit, Celsius;
clrscr();
printf("Enter Temperature in Fahrenheit \n");
scanf("%f",&Fahrenheit);
Celsius = 5.0/9.0 * (Fahrenheit-32);
printf("\n Temperature in Fahrenheit = %f", Fahrenheit);
printf("\n Temperature in Celsius = %f", Celsius);
getch();
}
Output :

I’m using Windows 7 – 64 bit. IDE = Emulated C++ 3.0
It seems to be a compiler issue. My compiler (Emulated Turbo C++ 3.0) was not able to save my edits properly. So I went to C:\TC\Bin\ filename.c and opened the file in Notepad. Corrected the errors and compiled it again.
Now it works 🙂