Untitled
By: a guest | Sep 5th, 2010 | Syntax:
None | Size: 0.46 KB | Hits: 24 | Expires: Never
#include <stdio.h>
/* print Fahrenheit-Celsius table
for fahr = 0, 20, ..., 300 */
main()
{
{
printf("fahrenheit to celsius\n");
}
int fahr, celsius;
int lower, upper, step;
lower = 31;
upper = 120;
step = 5;
/* lower limit of temperature scale */
/* upper limit */
/* step size */
fahr = lower;
while (fahr <= upper) {
celsius = 5 * (fahr-32) / 9;
printf("%d\t%d\n", fahr, celsius);
fahr = fahr + step;
}{
printf("fahrenheit to celsius\n");
}
}