C Programming :: Basic Concepts - Discussion
44 / 90
#include<stdio.h>
void main ( )
{
printf("\n Hello");
printf("\b world");
printf("\r Cup");
}
#include<stdio.h>
void main ( )
{
printf("\n Hello");
printf("\b world");
printf("\r Cup");
}
AHello
BHello World
CCup
Dworld
Show Explanation
If line 4 and 5 gets executed, it will print Hell world on the screen, due to '\b'.
Now, when line 4, 5 and 6 gets executed, it will print Cupl world on the screen, due to '\r' the control goes to the starting point and re-writes Hel with Cup.
So, the correct answer will be Cupl world.
Asked In ::
If line 4 gets executed alone, it will print Hello on the screen.
If line 4 and 5 gets executed, it will print Hell world on the screen, due to '\b'.
Now, when line 4, 5 and 6 gets executed, it will print Cupl world on the screen, due to '\r' the control goes to the starting point and re-writes Hel with Cup.
So, the correct answer will be Cupl world.
Read Full Answer
Report Error
Please Login First Click Here