Basic I/O

Here is a simple C++ program containing some I/O (input/output) statements.

#include <iostream>
using namespace std;
int main()
   int number;
   cout << "Please enter a number.";
   cin >> number;
   cout << "You entered: " << number << endl;
   return 0;
// end program

Let's breakdown this program, and see what it all means.

This page has been accessed     times.
Last modified: Sunday, 25-Mar-2012 17:01:40 CST
Copyright 2000 Department of Computer Science, University of Regina.

 CS Dept Home Page

Teaching Material