What is wrong with the following code, that getchar() won't wait for input?
Please help, thank you.
Code:#include <stdio.h> main() { float cel, fah; char r; do { printf("Input the Fahrenheit temperature you want to convert: "); scanf("%f", &fah); cel = (5.0/9.0)*(fah - 32); printf("%5.1f degree F is %5.1f degree C. ", fah, cel); printf("Do you want to continue? "); } while ((r = getchar()) == 'y'); }