GET EDUCATE

Contents
Basics of C Programming

⯈Basic C Programs

C Program to convert temperature in Celsius to Fahrenheit

The input to the program is temperature in Celsius and output to the program is temperature in Fahrenheit. 

Formula,

°F = (°C × 9/5) + 32,

Where C (Celsius) and F (Fahrenheit) are of type double.

C Program

#include<stdio.h>
int main()
{
double C, F;
printf("Enter temperature in Celsius:");
scanf("%lf",&C);
F = C * 9 / 5 + 32;
printf("Temperature in Fahrenheit = %lf\n",F);
return 0;
}

Output Window

output cel to far
Scroll to Top