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: Friday, 21-Aug-2020 15:28:13 CST
Copyright 2000 Department of Computer Science, University of Regina.


 CS Dept Home Page

Teaching Material