为什么此C代码无法在Terminal中正确执行,但可以在Xcode中正常运行?
int main () {
int farh, celcius;
int lower, upper, incr;
lower = 0; // The lowest fahrenheit tempeture allowed.
upper = 300; // Highest fahrenheit temperature allowed.
incr = 20; // The increments in which the fahrenheit increases until it reaches (upper)
printf("Thanks for using our converter!\n ");
farh = lower;
while (farh <= upper) {
celcius = 5 * (farh - 32) /9;
printf("%d\t%d\n", farh, celcius);
farh = farh + incr;
}
return 0;
}
输出: