Output of ..... System.Out.println ("Incredible" "\n" "world" );
Answers
Answered by
31
Heya user
Here is your answer !!
Input :
System.Out.println ("Incredible" "\n" "world" );
Output :
Incredible
world
Reason :
\n is an escape sequence which shifts the cursor to the next line . Hence , 'world' is printed in the next line .
Hope it helps !!
NOTE : See the attachment for more info on escape sequences .
Here is your answer !!
Input :
System.Out.println ("Incredible" "\n" "world" );
Output :
Incredible
world
Reason :
\n is an escape sequence which shifts the cursor to the next line . Hence , 'world' is printed in the next line .
Hope it helps !!
NOTE : See the attachment for more info on escape sequences .
Attachments:
BrainlyPromoter:
nice explanation
Answered by
42
Hey friend!
Output:
Incredible
world
Wanna know the reason?
Well here it is!
"\n" is not printed because it is used to move the cursor to the next line so that the word(words) can be printed to the next line and we need not write the "System.out.println" statements again and again.
Thanks and nice question!
Output:
Incredible
world
Wanna know the reason?
Well here it is!
"\n" is not printed because it is used to move the cursor to the next line so that the word(words) can be printed to the next line and we need not write the "System.out.println" statements again and again.
Thanks and nice question!
Similar questions