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 = "<
Using cin and cout can be much easier than printf or scanf, for simple input and output .