C Programming :: Basic Concepts - Discussion
4 / 90
#include<stdio.h>
int main()
{
printf("\nab");
printf("\bsi");
printf("\rha");
return 0;
}
#include<stdio.h>
int main()
{
printf("\nab");
printf("\bsi");
printf("\rha");
return 0;
}
Aabsiha
Bhai
Cab
Dsi
ENone of these
Show Explanation
Asked In ::
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.
Read Full Answer
Report Error
Please Login First Click Here