cin and cout

C++ offers two commands to facilitate the input and output of data.

The cin command takes input from the key board and directs it to variable, and cout takes data from a variable or string and displays it to the screen.

cin >> total; will take the number keyed in at the keyboard and store it in the variable total.

cout<<"this is the total = "< will display

Using cin and cout can be much easier than printf or scanf, for simple input and output .

BACK to Object Oriented Concepts.