C - Fahrenheit To Celsius Converter I have given here C Program source code to convert Fahrenheit to Celsius and Celsius to Fahrenheit. The forumula for conversion is given below: Celsius = (Fahrenheit - 32). 5 / 9.
To convert temperature from Fahrenheit to centigrade in C programming, you have to ask to the user to enter the temperature in Fahrenheit to convert it into centigrade to display the equivalent temperature value in centigrade as shown here in the following program. C Programming Code to Convert Fahrenheit to Centigrade.
In this C program to convert temperature from Fahrenheit to Celsius, we will take temperature in fahrenheit as input from user and convert to Celsius and print it on screen. To convert Fahrenheit to Celsius we will use following conversion expression: C = (F - 32). (5/9) where, F is temperature in fahrenheit and C is temperature in celsius.
·Published · Updated
Simple C program to convert temperature from either Fahrenheit to Celsius or vise-versa.
C++ program that reads a temperature C for Celsius or F for Fahrenheit. Print whether water is liquid, solid, or gaseous
Object:
Write a program that reads a temperature value and the letter C for Celsius or F for Fahrenheit. Print whether water is liquid, solid, or gaseous at the given temperature at sea level.
Code:
#include<iostream> #include<conio.h> using namespace std; void main() { float temp; char sel; cout<<“Select a temperature value in Celcius or Fahrenheit.n”; cout<<“Press C for Celcius.n”; cout<<“Press F for Fahrenheit.n”; cin>>sel; switch (sel) { case ‘C’: cout<<“Enter a temperature value in Celcius: “; cin>>temp; if(temp<=0) { cout<<“Water is solid at “<<temp<<” degree C.”; } else if(temp>=100) { cout<<“Water is gaseous at “<<temp<<” degree C.”; } else { cout<<“Water is liquid at “<<temp<<” degree C.”; } break; case ‘F’: cout<<“Enter a temperature value in Fahrenheit: “; cin>>temp; if(temp<=32) { cout<<“Water is solid at “<<temp<<” degree F.”; } else if(temp>=212) { cout<<“Water is gaseous at “<<temp<<“degree F.”; } else { cout<<“Water is liquid at “<<temp<<” F.”; } break; } getch(); }
){floattemp;charsel;cout<<'Select a temperature value in Celcius or Fahrenheit.n';cout<<'Press C for Celcius.n';cout<<'Press F for Fahrenheit.n';cin>>sel;switch(sel){case'C':cout<<'Enter a temperature value in Celcius: ';cin>>temp;if(temp<=0){cout<<'Water is solid at '<<temp<<' degree C.';}elseif(temp>=100){cout<<'Water is gaseous at '<<temp<<' degree C.';}else{cout<<'Water is liquid at '<<temp<<' degree C.';}break;case'F':cout<<'Enter a temperature value in Fahrenheit: ';cin>>temp;if(temp<=32){cout<<'Water is solid at '<<temp<<' degree F.';}elseif(temp>=212){cout<<'Water is gaseous at '<<temp<<'degree F.';}else{cout<<'Water is liquid at '<<temp<<' F.';}break;}getch();}
Output:
I have given here C++ Program source code to convert Fahrenheit to Celsius and Celsius to Fahrenheit.