×

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

How to find square root in C Language

Before understanding the square root program in C language, one must know about the square root of a number. A square root is a mathematical term. The square root of a...

5 minutes read.

Fibonacci Series in C Using For Loop

In this C article, we will let you know about the procedure of displaying the Fibonacci series of the first “n” positive integers. The syntax of for loop used in the...

4 minutes read.

Merge Sort in C

The merge sort follows the principle of the divide and conquers algorithm. Firstly it divides the input of an array into two halves and then calls itself for the two...

4 minutes read.

Ceil and Floor in C

In arithmetic, a rational number is a number that can be expressed as the quotient p/q of two integers. Where q is zero. The set of rational numbers includes all...

6 minutes read.

Purpose of a Function Prototype in C

A function prototype in C is a declaration of a function that specifies the function's name, return type and parameters. It has the following syntax: return_type function_name(parameter_list); For example, the prototype for...

4 minutes read.

Hook() function in C

Use of hook () function in C Introduction:  The hook () is a function used in the C programming language. The basic concept of the hook() function is that it can remove the function...

3 minutes read.

Caesar Cipher Program in C

What is Caesar Cipher? The Caesar Cipher is a type of substitution cipher that is named after Julius Caesar, who is said to have used it to encrypt messages sent to...

2 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.

C Switch Statements

Switch-case statement comes under the Selection control statement; there are four types of Control statements Decision-making statements (if, if-else)Selection statements (Switch-case)Iteration statements (for, while, do-while)Jump statements (break, continue, goto) If we want...

4 minutes read.

Pointer to pointer in C

A pointer to another pointer is another type of multiple indirections and a chain of many pointers. Generally, a pointer consists of the address of the variable. Once a pointer to...

4 minutes read.

Float in islower() in C

Introduction: This article briefly discusses the float in islower() in C. The islower() function checks if the input character passed inside the function is lowercase. Lowercase letters include (a-z). The islower()...

4 minutes read.

#define in C

#define in C In the C programming language, the preprocessor directive acts an important role within which the #define directive is present that is used to define the constant or the...

3 minutes read.

Flow Chart of For loop in C

This is a flowchart that represents the process of executing the for loop in the C programming language. Generally, as we know there are three main components of for loop:1. The...

3 minutes read.

Infix to Postfix program in C

Infix Expression: In infix expression, an operator is placed between the two operands. Example: x + y, here operator + is placed between operands x and y. Postfix Expression: In...

3 minutes read.

Difference between rand() and srand() function in C

What is the rand()? The rand() means random function. This function is used in C. It generates random numbers in the range of 0 to the RAND_MAX. Suppose we generate a...

3 minutes read.

Storage Class in C

C storage class is used to define the scope variables and function. There are four various types of storage classes that are given below. auto: The auto keyword is the default...

1 minute read.

Formatted Input and output function in C

Formatted I/O functions display multiple outputs to the user by taking various inputs. All data types like int, float, char and double are supported by the formatted I/O function. In...

4 minutes read.

2f in C language

Float data type in c: Double-precision floating-point numbers with up to 17 significant digits are stored in the FLOAT data type. FLOAT is equivalent to C's double data type and IEEE...

3 minutes read.

Functions in C

What is function? Functions are defined as the set of announcements which take inputs, perform operations and provide results. The operation of a function only performs when the function gets called....

4 minutes read.

C Program Swap Numbers in cyclic order Using Call by Reference

The three integers that the user entered in cyclical sequence are swapped in this tutorial using call by reference. C Program: #include <stdio.h> void cyclic_Swap ( int *X, int *Y, int *Z ); int...

2 minutes read.