C Programming/Basic Output/Example 1

This example will show you how to use escape sequences and do text formatting.



Here is the source code:

If you will notice, at the end of every string in the  functions there is a \n, this is so a new line starts for every line.

In the first  call there is a \" escape sequence. This is so the double quote will be printed to the console and not be seen by the compiler as something terminating or initiating a string. Same goes for the single quote in the third call of.

If you intend to print unformatted strings, you can use the function  to supply the same output:

always appends a newline to whatever it writes, so in this example there is no need for the newline escape sequences, except for the very last one where we require two (one supplied by, one supplied by our string).