C Program to Convert Celsius to Fahrenheit

C program to convert Celsius to Fahrenheit; Through this tutorial, we will learn how to convert celsius to Fahrenheit in c program.

Algorithm to Convert Celsius to Fahrenheit

Use the following algorithm to write a program to convert Celsius to Fahrenheit; as follows:

  • Start program.
  • Take an input celsius and store into a variable.
  • Convert to celsius to fahrenheit.
  • Print fahrenheit.
  • Stop program.

C Program to Convert Celsius to Fahrenheit

#include <stdio.h>

int main()
{
    float celsius, fahrenheit;

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

    // Convert the temperature from celsius to fahrenheit
    fahrenheit = ((celsius * 9)/5) + 32;
    // fahrenheit = ((9/5) * celsius) + 32;
    // fahrenheit = ((1.8 * celsius) + 32;

    printf("\n %.2f Celsius = %.2f Fahrenheit", celsius, fahrenheit);

    return 0;
}

The output of the above c program; as follows:

Please Enter temperature in Celsius: :- 100
100.00 Celsius = 212.00 Fahrenheit

Recommended C Programs

AuthorDevendra Dode

Greetings, I'm Devendra Dode, a full-stack developer, entrepreneur, and the proud owner of Tutsmake.com. My passion lies in crafting informative tutorials and offering valuable tips to assist fellow developers on their coding journey. Within my content, I cover a spectrum of technologies, including PHP, Python, JavaScript, jQuery, Laravel, Livewire, CodeIgniter, Node.js, Express.js, Vue.js, Angular.js, React.js, MySQL, MongoDB, REST APIs, Windows, XAMPP, Linux, Ubuntu, Amazon AWS, Composer, SEO, WordPress, SSL, and Bootstrap. Whether you're starting out or looking for advanced examples, I provide step-by-step guides and practical demonstrations to make your learning experience seamless. Let's explore the diverse realms of coding together.

Leave a Reply

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