Q. Determine the Final Output

Code:
void main()
{
      printf("\nab");
      printf("\bsi");
      printf("\rha");
}
  • (A) absiha
  • (B) asiha
  • (C) haasi
  • (D) hai
πŸ’¬ Discuss
βœ… Correct Answer: (D) hai
Explanation: \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
Explanation by: Prashant
\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

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
240
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Prashant
Publisher
πŸ“ˆ
87%
Success Rate