C Program to Convert Celsius to Fahrenheit

Are you learning C programming and looking for simple programs to build your basics?
In this tutorial, you’ll learn how to write a C program to convert Celsius (Centigrade) to Fahrenheit using a standard temperature conversion formula.


Formula for Temperature Conversion

To compute Fahrenheit (°F) from Celsius (°C), use the following formula:

F = (1.8 × C) + 32

Where:

  • F = temperature in Fahrenheit
  • C = temperature in Celsius

C Program to Convert Celsius to Fahrenheit

#include <stdio.h>

int main() {
    float celsius, fahrenheit;

    printf("Enter temperature in Celsius: ");
    scanf("%f", &celsius);

    fahrenheit = (1.8 * celsius) + 32;

    printf("Temperature in Fahrenheit: %.2f\n", fahrenheit);

    return 0;
}

Sample Output

Enter temperature in Celsius: 25
Temperature in Fahrenheit: 77.00

Why Learn This?

This simple temperature conversion program in C teaches you:

  • How to use float for decimal precision
  • Taking user input
  • Performing basic calculations
  • Displaying formatted output

These skills are essential for beginners to build confidence in programming.


Key Concepts Covered

  • Data types (float)
  • printf and scanf usage
  • Arithmetic expressions in C

External Reference

Celsius to Fahrenheit Explanation – NIST – A reliable guide to temperature conversions.


Previous Article

Convert Kilometers to Meters, Feet, Inches & Centimeters in C

Next Article

Kinematic Equation in C Programming: Calculate Distance Using d = ut + ½at²

Write a Comment

Leave a Comment

Your email address will not be published. Required fields are marked *

Subscribe to our Newsletter

Subscribe to our email newsletter to get the latest posts delivered right to your email.
Pure inspiration, zero spam ✨