// Write a program to perform Celsius to Fahrenheit conversion.
#include<iostream>
#include<conio.h>
int main()
{
clrscr();
float fahrenheit, celsius;
cout << "Enter the temperature in Celsius : ";
cin >> celsius;
fahrenheit = (celsius * 9.0) / 5.0 + 32;
cout<<"The temperature in Celsius : " << celsius << endl;
cout<<"The temperature in Fahrenheit:" << fahrenheit << endl;
getch();
return 0;
}
Output:-
#include<iostream>
#include<conio.h>
int main()
{
clrscr();
float fahrenheit, celsius;
cout << "Enter the temperature in Celsius : ";
cin >> celsius;
fahrenheit = (celsius * 9.0) / 5.0 + 32;
cout<<"The temperature in Celsius : " << celsius << endl;
cout<<"The temperature in Fahrenheit:" << fahrenheit << endl;
getch();
return 0;
}
Output:-
No comments:
Post a Comment