21 : C Program to Convert Fahrenheit to Degree

Check out the complete list of c-programs : C Program List    

Ask user to enter temperature in fahrenheit and calulate the conversion to degree using the formula given below.

Variables :

1. fahrenheit : (Datatype float) : to hold temperature in fahrenheit entered by the user.

2. degree : (Datatype float) : to hold Degree value computed.

Functions :

printf() : is used to display something on the console/screen. Format specifier %f in printf function is used to display a float variable on screen. \n is used to add a newline

scanf() : is used to fetch data inputted by the user on the console/screen using keyboard. %f in scanf is indicates that inputted text is of type float.

Formula :

Degree = (Fahrenheit-32) x (5/9)

 * 1000+ C programs + tutorials
 * 21_fahrenheit_to_degree_celsius_converter.c
 *  Created on: Oct 20, 2014
 *  Author: Code2care.org


void main() {

  float degree;
  float fahrenheit;

//    clrscr();

	printf(" Program to convert Temperature Fahrenheit to Degree Celsius:  ");

	printf("\n\n Enter Temperature in Fahrenheit  : ");
	scanf("%f", &fahrenheit);
    degree = (fahrenheit-32)*(5/9);
    printf("\n\n %f Fahrenheit in Degree Celsius = %f  \n",fahrenheit,degree);

//	getch();


The best way to learn C programming is to practice more and more of programs . Code2care C Programming tutorials provide 1000+ programs in C that you can study and become an expert in the language. Programs are divided into categories depending upon type and complexity.

BSc. IT, BSc. Computer Science, BSc. IT, MSc. IT, MSc. Computer Science, MCA, BTech IT & BTech Engineers may find these programs very useful.