2024-04-16 19:13:00 -04:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2024-05-02 09:52:00 -04:00
|
|
|
// converting Fahrenheit to Celsius
|
|
|
|
|
2024-04-16 19:13:00 -04:00
|
|
|
main()
|
|
|
|
{
|
|
|
|
float fahr, celsius;
|
|
|
|
int lower, upper, step;
|
|
|
|
|
|
|
|
lower = 0;
|
|
|
|
upper = 300;
|
|
|
|
step = 20;
|
|
|
|
|
|
|
|
fahr = lower;
|
|
|
|
printf("%10s %7s\n", "Fahrenheit", "Celsius");
|
|
|
|
while (fahr <= upper)
|
|
|
|
{
|
|
|
|
celsius = (5.0 / 9.0) * (fahr - 32.0);
|
|
|
|
printf("%10.0f %7.1f\n", fahr, celsius);
|
|
|
|
fahr = fahr + step;
|
|
|
|
}
|
|
|
|
}
|