C Programming - Strings - Discussion

Discussion Forum : Strings - General Questions (Q.No. 3)
3.
How will you print \n on the screen?
printf("\n");
echo "\\n";
printf('\n');
printf("\\n");
Answer: Option
Explanation:

The statement printf("\\n"); prints '\n' on the screen.

Discussion:
23 comments Page 2 of 3.

Anuja said:   9 years ago
\n changes the line. But we wanna print \n so we have to take one "\".

Pradeepa said:   9 years ago
This was really a good concept & useful discussion, Thank you friends.

Tina Jadhav said:   1 decade ago
Usually we use \n, never heard about"\\n". When we have to use this?

Karthik saakre said:   1 decade ago
Actually, printf ("\n") : will skip a line leaving the current line.

Venkatesh said:   9 years ago
\ is escape sequence escape after letter while compilation.

Suraj kumar said:   1 decade ago
Can anyone explain, how the statement. echo "\\n";. Works ?

Sasi said:   1 decade ago
Never heard about "\\n" can anyone explain in detail?

123 said:   9 years ago
Please explain the concept with an example.

Sunny said:   1 decade ago
Great. Really good one example.

Apshana said:   1 decade ago
Why \ is used before \n?


Post your comments here:

Your comments will be displayed after verification.