12th Class NCERT Solution Download Click Here!

X




Sunday, 13 March 2016

Write a program which accept temperature in Farenheit and print it in centigrade.

#include<iostream>
using namespace std;

int main()
{
 float F,C;
 cout<< "\nEnter temperature in Farenheit : ";
 cin>>F;
 C=5*(F-32)/9;
 cout<<"Temperature in celcius is : "<<C;
 
 
 return 0;
}


OUTPUT:

Enter temperature in Farenheit : 98.6
Temperature in celcius is : 37

HINT : We should only know the formula for conversion. Rest is simply done by cin and cout.


No comments:

Post a Comment