Convert Celsius to Fahrenheit using double type - C++ Data Type

C++ examples for Data Type:double

Description

Convert Celsius to Fahrenheit using double type

Demo Code

#include <iostream>
using namespace std;
int main()//from w w w  .  java 2s.  c  o  m
{
   double  ctemp, ftemp;
   cout << "Input a Celsius temp and press ENTER: ";
   cin >> ctemp;
   ftemp = (ctemp * 1.8) + 32;
   cout << "Fahrenheit temp is: " << ftemp;
   return 0;
}

Result


Related Tutorials