/*THIS ONE IS FULL OF BUGS: FIND ALL OF THEM, WITHOUT LOOKING BACK!*/
#include <stdio.h>
int main(void);
{
double fahr, cels;
char scale;
printf("Type C to convert Celsius to Fahrenheit, or F to go the other way: ");
scale = toupper(getchar());
printf("degrees? ");
scanf("%f", ((scale='C')? &cels: &fahr));
if(scale = 'C') {
fahr = 9.0*cels/5.0+32.0;
} else {
cels = 5.0 * fahr-32.0 / 9.0;
}
printf("%d degrees Fahrenheit is %d degrees Celsius", fahr, cels);
return 0;
}