C Program to Convert Celsius to Fahrenheit

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

AuthorAdmin

My name is Devendra Dode. I am a full-stack developer, entrepreneur, and owner of Tutsmake.com. I like writing tutorials and tips that can help other developers. I share tutorials of 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 from a starting stage. As well as demo example.

Leave a Reply

Your email address will not be published.