you can store the newline character into a variable:
ch = \n ;
You also can put the newline character into a string just as you can any printable character:
cout << Hello\n;
This last statement has exactly the same effect as the statement
cout << Hello << endl ;
But back to our discussion of input. Let's look at some examples using the reading marker and the newline character. In the following table, i is an int variable, ch is a char variable, and x is a float variable. The input statements produce the results shown. The part of the input stream printed in color is what has been extracted by input statements. The reading marker, denoted by the shaded block, indicates the next character waiting to be read. The \n denotes the newline character produced by striking the Return or Enter key.