C Programming :: Basic Concepts
4. What is the output of the following C Program?
\n - newline
\b - backspace
\r - linefeed
19 Apr, 2019 2:46 PM
Let us first know about the escape sequences used in the above code-
Escape Sequence Function
\n newline-used for printing anything in new line.
\b backspace-makes the cursor shift backwards, without erasing any data and replacing the current character encountered with new entered one.
\r carriage return-It takes the cursor at the starting of the line.
Line 4 prints ab. Line 5 replaces ab with si. Line 6 takes the cursor to starting point, replaces s with ha, leaving the final output as hai.
Please Login First Click Here