C++ examples for File Stream:cout
Combining the conversion and output for calculation
#include <iostream> using namespace std; int main()//from ww w .ja v a 2s.c o m { double ctemp; // Celsius temperature // Prompt and input value of ctemp. cout << "Input a Celsius temp and press ENTER: "; cin >> ctemp; // Convert ctemp and output results. cout << "Fahr. temp is: " << (ctemp * 1.8) + 32; cout << endl; return 0; }