Pages

Labels

C Program to convert centigrade into Fahrenheit and Kelvin

This program ask input in degree celsius and gives output in fahrenheit and Kelvin

#include <stdio.h>
#include <math.h>
main () {
  float c, fe, k;
  printf ("Enter the temperature in Degree Celsius:");
  scanf ("%f",  &c);
  fe = 1.8 * c + 32;
  k = 273 + c;
  printf ("The temperature in Fahrenheit is:%f\n", fe);
  printf ("The temperature in Kelvin is:%f\n", k);
  getch ();
}



Output::---
Enter the temperature in Degree Celsius: 20.0
The temperature in Fahrenheit is: 68.0
The temperature in Kelvin is: 293.0

How it works
After getting value in degree celsius, it calculate Fahrenheit and Kelvin by using conversion formula shown in the above program.

Followers