Computer Science, asked by uniyala84, 1 year ago

Output of ..... System.Out.println ("Incredible" "\n" "world" );

Answers

Answered by Incredible29
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 .
Attachments:

BrainlyPromoter: nice explanation
Incredible29: thnq ... u xplained quite well too!! :)
BrainlyPromoter: thanks dear
uniyala84: Woaahhh thanks a lot
BrainlyPromoter: thanks for giving me a chance to help you
Answered by BrainlyPromoter
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!

uniyala84: Thank you sooo much I was actually very confused
BrainlyPromoter: no problem
Similar questions