Home C-tutorials C Temperature Converter



C Temperature Converter
Posted on: February 6, 2009 at 12:00 AM
Here we are going to illustrates you how to convert temperature from Celsius to Fahrenheit in C.

C Temperature Converter

     

Here we are going to illustrates you how to convert temperature from Celsius to Fahrenheit in C. You can see in the given example, we prompt the user to enter the temperature in celsius. The scanf() function gets the entered temperature and by using the following statement shown, the temperature is converted into Fahrenheit

fahrenheit = (1.8 * celcius) + 32;

Here is the code:

 

 

 

TEMPCONV.C

#include <stdio.h>
#include <conio.h>
int main() {
  float celcius, fahrenheit;
  printf("Enter the value of Temperature in Celsius: ");
  scanf("%f", &celcius);
  fahrenheit = (1.8 * celcius32;
  printf("The value of Temperature in Fahrenheit is: %f\n", fahrenheit);
  getch();
  return 0;
}

Output will be displayed as:

TEMPCONV.EXE

Download Source Code:

Related Tags for C Temperature Converter:
cconvertuserpromptexampletoexameilitlscanusepefromceenterinmnttrtempcaestemperatureemhowhrprorateratesxaxampseeatllivmplgoarstrrtssrenthstpleplpronomo


More Tutorials from this section

Ask Questions?    Discuss: C Temperature Converter  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.