Showing posts with label temperature converter. Show all posts
Showing posts with label temperature converter. Show all posts

Tuesday, March 15, 2011

Program that takes input in Celsius and converts to fahrenheit

This is a beginner program which prompts user to input temperature in Celsius and outputs the temperature in Fahrenheit.


#include
using namespace std;
void main()
{
float fahrenheit=0.0, celsius=0.0;
cout<<"Enter Teperature in Celsius: "; cin>>celsius;
fahrenheit = ((celsius + 32)*9)/5;
cout<<"\nIn Fahrenheit: "<< fahrenheit;

}