C Programming Code Examples C > Beginners Lab Assignments Code Examples convert temperature from degree celsius to fahrenheit convert temperature from degree celsius to fahrenheit Write a C program to input temperature in Centigrade and convert to Fahrenheit. How to convert temperature from degree centigrade to degree Fahrenheit in C programming. The logic of temperature conversion exists in converting mathematical formula to C expression. You just need to convert mathematical formula of temperature in C language. Rest is simple input/output. Input temperature in Celsius from user. Store it in some variable say celsius. Apply formula to convert the temperature to Fahrenheit i.e. fahrenheit = (celsius * 9 / 5) + 32. Print the value of fahrenheit. #include <stdio.h> int main() { float celsius, fahrenheit; /* Input temperature in celsius */ printf("Enter temperature in Celsius: "); scanf("%f", &celsius); /* celsius to fahrenheit conversion formula */ fahrenheit = (celsius * 9 / 5) + 32; printf("%.2f Celsius = %.2f Fahrenheit", celsius, fahrenheit); return 0; }