C Programming - Strings - Discussion
|
|
|
|
Read more:"Success has many fathers, while failure is an orphan."
- (Proverb)
|
| 3. |
How will you print \n on the screen? |
| [A]. |
printf("\n"); | [B]. |
echo "\\n"; | | [C]. |
printf('\n'); | [D]. |
printf("\\n"); |
Answer: Option B
Explanation:
The statement printf("\\n"); prints '\n' on the screen.
|
|
Sunny said:
(Thu, Mar 17, 2011 12:45:48 PM)
|
|
| |
| Great. Really good one example. |
|
Shashank said:
(Sun, Sep 18, 2011 10:37:59 PM)
|
|
| |
| Give me specific reason about this answer. Why there is "\\" is used ? |
|
Deepak said:
(Mon, Oct 10, 2011 10:18:26 PM)
|
|
| |
| Give me specific reason about this answer. Why there is "\\" is used ? |
|
Vinod said:
(Sat, Jan 7, 2012 02:12:41 PM)
|
|
| |
| This is verbatim string. Putting any special character after "\" sign ignoresthe next character for compilation. |
|
|