I am pretty new to C programming, I used Pascal before.
I've tried to write a program which converts between Fahrenheit and Celsius.
But when I ask the user to write a char, the program doesnt recognize it. I did a simple test, and I found, that my program saves the enter (\n) as well as the char. But that's not supposed to be. So how to solve this?
I used Borland C++ Builder.
Thanks for any help!
int main (void)
printf("Convert celsius or fahrenheit? c-f");
if (CorFahr == 'c' || CorFahr == 'f')
printf("write c or f");
while (CorFahr != 'c' || CorFahr != 'f');
if (CorFahr == 'c' )
printf("%f in celsius: ",convertable);
if (CorFahr == 'f')
printf("%f in fahrenheit: ",convertable);