C Program for Temperature Conversion from Fahrenheit to Celsius

C Program for Temperature Conversion from Fahrenheit to Celsius.


C Program for Temperature Conversion from Fahrenheit to Celsius Images-Pics-Pictures-Photos-Snaps-Snapshots-Basic C Programs-C Language Programs-C Program to Convert Fahrenheit to Celsius-General C Programs-Convert Temperature-C Program to Convert Celsius to Fahrenheit-K&RC Program.


--------------------------------------------------------------------------------------------------------------------------

#include<stdio.h>
int main(void)
{
    float fahrenheit, celsius;
    int lower, upper, step;
    lower = 0;
    upper = 200;
    step = 20;
    printf("F\tC")
    printf("\n-------");
    fahrenheit = lower;
    while(fahrenheit <=upper)
    {
        celsius = (5.0/9.0)*(fahrenheit-32.0);
        printf("\n%3.0f%6.1f",fahrenheit,celsius);
        fahrenheit = fahrenheit+step;
     }
return 0;
}

--------------------------------------------------------------------------------------------------------------------------

Output

--------------------------------------------------------------------------------------------------------------------------

F    C
0     17.8
20   -6.7
40    4.4
60    15.6
80    26.7
100  37.8





EmoticonEmoticon