1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
// basics/c2f.cpp - Convert Celsius to Fahrenheit
// Fred Swartz, 2003-10-26 // (1)
#include <iostream> // (2)
using namespace std; // (3)
int main() { // (4)
float celsius; // (5)
float fahrenheit;
cout << "Enter Celsius temperature: "; // (6)
cin >> celsius;
fahrenheit = 1.8 * celsius + 32;
cout << "Fahrenheit = " << fahrenheit << endl;
system("PAUSE"); // only Dev-C++ // (7)
return 0; // (8)
}
The text from the above example can be selected, copied, and pasted into an editor.
|