TEMPERATURE

TO CONVERT FAHRENHEIT INTO CELSIUS 

#include<stdio.h>
#include<conio.h>
void main()
{
    float f,c;
    printf("enter temperature of city in fahrenheit = ");
    scanf("%f",&f);
    {
        c=(f-32)*5/9;
    }
    {
        printf("temperature in Celsius = %f ",c);
    }
    getch();
}

OUTPUT :

enter temperature of city in fahrenheit = 100
temperature in Celsius = 37.777779

_______________________

TO  CONVERT CELSIUS INTO FAHRENHEIT 

#include<stdio.h>
#include<conio.h>
void main()

{

    float f,c;
    printf("enter temperature of city in Celsius = ");
    scanf("%f",&c);
    {
        f=(c*9/5)+32;
    }
    {
        printf("temperature in fahrenheit = %f ",f);
    }
    getch();
}


OUTPUT  :

enter temperature of city in Celsius = 100

temperature in fahrenheit = 212.000000



Comments