22 lines
362 B
C
22 lines
362 B
C
#include <stdio.h>
|
|
|
|
// converting celsius to fahrenheit
|
|
main()
|
|
{
|
|
float fahr, celsius;
|
|
int lower, upper, step;
|
|
|
|
lower = 0;
|
|
upper = 300;
|
|
step = 20;
|
|
|
|
celsius = lower;
|
|
printf("%10s %7s\n", "Fahrenheit", "Celsius");
|
|
while (celsius <= upper)
|
|
{
|
|
fahr = (celsius * 9.0 / 5.0) + 32.0;
|
|
printf("%10.0f %7.1f\n", fahr, celsius);
|
|
celsius = celsius + step;
|
|
}
|
|
}
|