×

Fahrenheit to Celsius in C

  • Before going into conversion, we have to know what Fahrenheit and Celsius mean, these are both units to measure the temperature.
  • In our daily life, we use both Fahrenheit and Celsius, to measure the temperature of anything which is denoted by unit the Celsius.
  • The temperature of a body is denoted by unit the Fahrenheit.
  • And we can convert the Fahrenheit units to Celsius unit easily.
  • The mathematical formula to convert Fahrenheit to Celsius unit is by
    • Celsius = ( 5 / 9 ) * ( Fahrenheit unit – 32 )
  • For example, we can convert 200 Fahrenheit into 93.3 Celsius.
    Algorithm to convert Fahrenheit to Celsius in c:
    1. Declare two variables f,c
    2. Enter the Fahrenheit value after compiling at run time
    3. Apply the formula to convert
      C = ( f – 32 ) * ( 5 / 9 );
    4. Print the Celsius unit
/ / program to convert Fahrenheit to Celsius in c
# include <stdio.h>
/ / main function
int main ( ) {
/ /  declare the varaibles
float c, fa;
printf (“ enter the Fahrenheit temperature : \n”);
scanf (“ %f “, &fa);
/ / convert form Fahrenheit to Celsius using the formula
/ / c = ( fa – 32 ) * 0.55556
c = ( fa – 32 ) * ( 5 * 9 );
/ / print the converted units
printf ( “ %.2f Fahrenheit = %.2f Celsius “, fa,c);
return 0;
}

Program to convert Fahrenheit to Celsius in c:

Output:

Enter the Fahrenheit temperature:
100
100.00 Fahrenheit = 37.77 Celsius
Enter the Fahrenheit temperature:
77
77.00 Fahrenheit = Celsius

Related Topics

Beep() function in C

Introduction: Beep is a function which is used in C programming language. The beep function uses to make a beep sound. In the C language, when we want to generate...

3 minutes read.

Find the Largest Three Distinct Elements in an Array using C/C++

In this tutorial, we will demonstrate how to use a C/C++ programme to locate the highest three different elements in an array. C/C++ Program to Find the Largest Three Different Elements...

3 minutes read.

Enumeration (Enum) in C

Enumeration (Enum) in C: In the C programming language, the enum is referred to as an enumerated type. Enum is a user defined data type consisting of integer values and...

3 minutes read.

Compilation Process in C language

What is the Compilation Process?  The compilation is a method whereby the source code is converted into object code. It is achieved with compiler assistance. The compiler tests the source code for syntactic...

3 minutes read.

Sum of digits in C++

Sum of digits in C++ There are various ways to find the sum of the digits of a number in C++. We can use containers like arrays or other simple cases...

4 minutes read.

Null character in C

Introduction The Null character in the C programming language is used to terminate the character strings. In other words, the Null character is used to represent the end of the string...

3 minutes read.

How to create a node in C?

A node is a small concept taken from the graph theory, or a node is a fundamental unit of a data structure, like a tree data structure. Every graph contains...

3 minutes read.

How to Avoid Structure Padding in C

Generally, when an object of some structure type is declared, some contiguous memory will be allocated in block form, which will be allocated to structure members. To understand structure padding...

3 minutes read.

C –Structure

C structure is a collection of different types of data that is grouped together. It is used to represent records.Structkeyword is used to create a structure. Each element of a...

1 minute read.

fopen() function in C

fopen() function, is one of the file handling functions. It is used to open the existing file and perform operations on the file. If the file does not exist, it...

3 minutes read.

C pre-processor

The C processor is a macro processor which is used to compile the source code of the program (step by step) . It is not a part of the compiler....

4 minutes read.

Ferror() in c

Ferror():  In C, the ferror() function checks assuming there is a blunder in the given stream. The ferror() function is utilized to check for the document blunder on given stream. A return...

4 minutes read.

Nested Loops in C Programming Examples

A nested loop is generally used when we want to run a loop statement inside another loop statement. This kind of loop is also known as a “loop inside the...

6 minutes read.

C Program to Find Largest Number Using Dynamic Memory Allocation

This tutorial will teach us how to locate the highest number a user has ever input into a dynamically allocated memory. C Program: #include <stdio.h> #include <stdlib.h> int main ()  {   int no;   double *data_n;   printf...

1 minute read.

Data Types in C

Data type is a very important concept in C programming language. Simply, “A data type is the classification of data values that a data item can have.” We need to...

11 minutes read.

Free() Function in C

Free() function is a built-in function which is define in the stdlib.h header file. If we want to use this function in our program, we must include the stdlib.h header...

4 minutes read.

Array to function in C

Array to function in C We can create functions that receive an array as an argument. To pass an array into a function, we need to write the name of the...

4 minutes read.

Bank Account System in C using File Handling

This tells about the creation of bank account system using the C language and handling of files in C. Approach Let us see the approaches and the functions how they are covering...

5 minutes read.

String Handling functions in C

String :- The String is the collection of characters. Every String ends with the null character, and the String is enclosed in the double quotations .ie, "javaTpoint". If we see any...

5 minutes read.

Format Specifier in C

Format Specifier in C Format specifiers can be described as an operator that is used to print the data referred by any object or variable in combination with the printf ()...

3 minutes read.