(iii) Write a C++ program where the user will enter temperature in Fahrenheit to convert it into
Centigrade, then display the result on the screen:
#include<iostream>
using namespace std;
int main()
{
float fah, cel;
cout<<"Enter the Temperature in Fahrenheit: ";
cin>>fah;
cel = (fah-32)/1.8;
cout<<"\nEquivalent Temperature in Celsius: "<<cel;
cout<<endl;
return 0;
}
Comments
Leave a comment