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;

}

No comments:

Post a Comment

Please comment, if you like the post, you find any mistake or if you have any query.