C++ int type convert fahrenheit to Celsius

Description

C++ int type convert fahrenheit to Celsius

#include <iostream>
using namespace std;
int main()//w  ww  . ja v  a  2 s .com
{
   int ftemp;  //for temperature in fahrenheit
   cout << "Enter temperature in fahrenheit: ";
   cin >> ftemp;
   int ctemp = (ftemp-32) * 5 / 9;
   cout << "Equivalent in Celsius is: " << ctemp << '\n';
   cout << "this is a test\n";
   return 0;
}



PreviousNext

Related