?
Determine the Final Output:
Determine the Final Output:
void main()
{
printf("\nab");
printf("\bsi");
printf("\rha");
}
void main()
{
printf("\nab");
printf("\bsi");
printf("\rha");
}
Answer & Solution
Correct Answer:
Option
D
\n - newline - printf("\nab"); - Prints ab
\b - backspace - printf("\bsi"); - firstly '\b' removes 'b' from 'ab ' and then prints 'si'. So after execution of printf
Join the Discussion
Login to post a comment or share your explanation.
LoginSomeone pls explain
b - backspace - firstly 'b' removes 'b' from 'ab ' and then prints 'asi'.
r - currsor point to start and then ha overrides as and then print hai
skip only first 2 spaces
ab
b : back one character
write si : overrides the b with s (producing asi on the second line)
r : back at the beginning of the current line
write ha : overrides the first two characters (producing hai on the second line)
in our program in last statement we have /r so it removes first two character an prints ha in place of it therefore output is 'hai'