C++ examples for Language Basics:Console
Demonstrates cin, newline
#include <iostream> using namespace std; int main()/* w ww . j a v a 2 s.c om*/ { int ftemp; //for temperature in fahrenheit cout << "Enter temperature in fahrenheit: "; cin >> ftemp; int ctemp = (ftemp-32) * 5 / 9; cout << "Equivalent in Celsius is: " << ctemp << '\n'; cout << "this is a test\n"; return 0; }