printf("Hello, World!\n");. why we put( !\n) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

printf("Hello, World!\n");. why we put( !\n)

8th Mar 2020, 11:13 PM
Yasser Mhj
Yasser Mhj - avatar
8 Answers
+ 5
! Will be printed and \n is for newline
8th Mar 2020, 11:25 PM
✳AsterisK✳
✳AsterisK✳ - avatar
+ 4
The '\n' is an escape character used to insert line break. This means whatever comes after '\n' will be printed on the next line. I think the lesson covered this somewhere, see if you can find it 👍 (Edited)
8th Mar 2020, 11:29 PM
Ipang
+ 3
Yasser Mhj "!" Will be printed as it is
8th Mar 2020, 11:50 PM
Abhay
Abhay - avatar
+ 3
The exclamation mark is just an ordinary character which will be printed. \n is a line break. Everything after \n will be printed in a new line
10th Mar 2020, 2:52 PM
Jannik Müller
Jannik Müller - avatar
+ 1
and the !
8th Mar 2020, 11:32 PM
Yasser Mhj
Yasser Mhj - avatar
+ 1
Create new line
10th Mar 2020, 3:47 PM
Junior Santos
Junior Santos - avatar
0
thanks
8th Mar 2020, 11:27 PM
Yasser Mhj
Yasser Mhj - avatar
0
!!!
8th Mar 2020, 11:32 PM
Yasser Mhj
Yasser Mhj - avatar