Fahreinheit to Kelvin

From Shannon, 3 Years ago, written in C++, viewed 210 times.
URL https://paste.codexterous.com/view/94aacaeb Embed
Download Paste or View Raw
  1. Write a program that converts Fahreinheit to Kelvin.  Round to one decimal place.  The formula is as follows:
  2. (F - 32) * (5 / 9) + 273.15
  3.  
  4.  
  5.  
  6. #include <iostream>
  7. #include <iomanip>
  8. using namespace std;
  9.  
  10. int main ()
  11. {
  12.     cout << fixed;
  13.     float fah, kelvin;
  14.  
  15.     cout << "== Fahrenheit to Kelvin converter ==" << endl;
  16.     cin >> fah;
  17.     cout << "Enter Fahrenheit:";
  18.     cin >> fah;
  19.     kelvin = (5/9) * fah + 273.15;
  20.  
  21.     cout << fah << " Fahreinheit = " <<  setprecision(1) << kelvin << "kelvin" << endl;
  22.  
  23. return 0;
  24. }
  25.  

Replies to Fahreinheit to Kelvin rss

Title Name Language When
Re: Fahreinheit to Kelvin Shannon cpp 3 Years ago.

Reply to "Fahreinheit to Kelvin"

Here you can reply to the paste above