mirror of
https://github.com/VictorEijkhout/TheArtOfHPC_vol3_cppf08programming.git
synced 2026-01-24 22:44:48 +09:00
24 lines
596 B
C++
24 lines
596 B
C++
/****************************************************************
|
|
****
|
|
**** This file belongs with the course
|
|
**** Introduction to Scientific Programming in C++/Fortran2003
|
|
**** copyright 2016/7 Victor Eijkhout eijkhout@tacc.utexas.edu
|
|
****
|
|
**** c2f.cxx : centigrade to fahrenheit conversion
|
|
****
|
|
****************************************************************/
|
|
|
|
#include <iostream>
|
|
using std::cin, std::cout;
|
|
|
|
int main() {
|
|
float c,f;
|
|
|
|
cout << "Enter a temperature in Celsius: " << '\n';
|
|
cin >> c;
|
|
f = 9*c/5+32;
|
|
cout << "Equivalent Fahrenheit: " << f << '\n';
|
|
|
|
return 0;
|
|
}
|