Program 2: Accept temperature in  fahrenheit (f) and print in celcius(c), kelvin(k). #include <stdio.h> void main() {   ...

C Program to find temperature in celcius and kelvin.



Program 2: Accept temperature in fahrenheit(f) and print in celcius(c), kelvin(k).
#include <stdio.h>
void main()
{
    float cel, fahr,kel;
    printf("Enter the temperature in fahrenheit:");
    scanf("%f",&fahr);
    cel=5.0/9*(fahr-32);
    kel=cel+273.15;
    printf("Enter the temperature in celcius =%f\n",cel);
    printf("The temperature in kelvin=%f",kel);
}

Output
[root@localhost ~]# cd ~/Desktop
[root@localhost Desktop]# gcc fck.c
[root@localhost Desktop]# ./a.out
Enter the temperature in fahrenheit: 30
Enter the temperature in celcius =-1.111111
The temperature in kelvin=272.038879 😊

0 coment�rios:

HTML5 CSS3 TUTORIAL FOR BEGINNERS