You are here:   HomeC Programming (Pratical)C Program Print The Number
by Dinesh Thakur Category: C Programming (Pratical)

In this program user convert the temperature from Fahrenheit to Celsius. User declares required variables for containing the value in it. User declares the value to variables manually to make process of temperature conversion. Then while condition for laying the condition complete. In while condition the method is been used for temperature conversion that are required. Then a printing method to print result on the screen.

Problem Statement:

  1. Declaring variable.
  2. Using condition as required.
  3. Using conversion method.
  4. Display result on screen

Method for Converting Fahrenheit to Celsius.

“ Celsius = (5.0 / 9.0) * (fahr - 32.0);”

Here is C source code for Converting temperature from Fahrenheit to Celsius. The output of this program shown below. 



#include <stdio.h>

int main(void)
{
      float fahr, celsius;
      int lower, upper, step;
      clrscr();
      lower = 0;
      upper = 300;
      step = 20;
      printf("F       C\n\n");
      fahr = lower;
      while(fahr <= upper)
             {
                  celsius = (5.0 / 9.0) * (fahr - 32.0);
                  printf("%3.0f %6.1f\n", fahr, celsius);
                  fahr = fahr + step;
             }
                  getch();
                  return 0;

Fahrenheit to Celsius



Search Content







Advance Courses



Basic Courses



Advertise with Us