C Program to Convert the temperature from Celsius to Fahrenheit

In this example, we will find the C Program to Convert the temperature from Celsius to Fahrenheit.

Celcius :- Celsius, also called centigrade, scale for measuring temperatures based on 0° for the freezing point of water and 100° for the boiling point of water.

Fahrenheit :- Fahrenheit, scale is based on 32° for the freezing point of water and 212° for the boiling point of water, the interval between the two is divided into 180 equal parts.

Formulae :- F = 1.8*C+32 (where C is the temperature in Celsius)

EXAMPLE :-
     Input - Temperature in Celsius = 100
     output - Temperature in Fahrenheit = 212

C Program to Convert the temperature from Celsius to Fahrenheit

/* C-Program: Convert Centigrade to Fahrenheit temperature */
#include <stdio.h>

int main()
{
  
  float c,f;
  printf("Enter the temperature in Celsius: ");
  scanf("%f", &c);
  f = 1.8*c+32;
  printf("\nCelsius Temperature = %.1f \n", c);
  printf("\nFahrenheit Temperature = %.1f \n", f);

return 0;
}

 

Output :-

Enter the temperature in Celsius: 100

Celsius Temperature =   100.00

Fahrenheit Temperature =   212.00
Related Articles

Leave a Reply