HOW TO PRINT "n" in C?

Showing Answers 1 - 75 of 151 Answers

Steve

  • Sep 12th, 2006
 

printf("n");

  Was this answer useful?  Yes

ch

  • Sep 13th, 2006
 

printf(""n"")

  Was this answer useful?  Yes

akhilesh

  • Sep 13th, 2006
 

printf("%c%c%c",34,110,34);

  Was this answer useful?  Yes

ani

  • Sep 16th, 2006
 

i think printf("%c%c%c",34,110,34);

only seems 2 be working all the others are going 2 get syntax errors in c.

  Was this answer useful?  Yes

yael

  • Sep 18th, 2006
 

printf(""""n"""");

  Was this answer useful?  Yes

jay

  • Sep 23rd, 2006
 

The proper way to print " is using the " syntax, so : printf(""n"");

  Was this answer useful?  Yes

Jitu

  • Sep 25th, 2006
 

What you all people want to do???Please try it and then write the answer..Correct answer isprintf(""n"");

  Was this answer useful?  Yes

pradeep

  • Sep 25th, 2006
 

printf(""n"");

this  works, surely

  Was this answer useful?  Yes

milind

  • Sep 26th, 2006
 

printf("n");

  Was this answer useful?  Yes

hemanth

  • Sep 29th, 2006
 

printf(""n"");

  Was this answer useful?  Yes

ABHAY

  • Oct 11th, 2006
 

printf(""n"");

  Was this answer useful?  Yes

Gaurav Kaushik

  • Oct 12th, 2006
 

#includeint main(){ printf(""n"");}

  Was this answer useful?  Yes

sanjaya B

  • Oct 13th, 2006
 


 printf(""n"");

  Was this answer useful?  Yes

Ramana Babu

  • Dec 4th, 2006
 

void main(void)
{
  printf(""n"");

}

  Was this answer useful?  Yes

Mahendra Kathe

  • Dec 9th, 2006
 

Nice question , but got cracked here

printf(""n"");

looks strange but definitely works.

  Was this answer useful?  Yes

rekha123456

  • Apr 23rd, 2007
 

void main()

  printf(""""n"""");
}

or

void main()

 printf("%c%c%c",34,110,34);
}

  Was this answer useful?  Yes

ardashev

  • Nov 17th, 2007
 

I don't get it:

on linux with gcc -pedantic

printf("n");

works just fine
while

printf("n");

means end of line


whats going on ???

  Was this answer useful?  Yes

yess.. it is not visible.. as it is filtered out.. to protect the site from XSS attacks..tats why... we cant see it

anyway.. rt answer is..

printf("back slash"nbackslash");

  Was this answer useful?  Yes

May be this is Compiler dependent.
when i tried with VC++ Editor.
the below statement which you have mentioned not working.

printf(""n"");
printf(""""n"""");

Both are giving compile time error.

Printf("""n"""); this is giving the output as n not "n".


The below statement is working fine to printf the "n".

 printf("%c%c%c",34,110,34);

  Was this answer useful?  Yes

Because symbol " has special meaning in printf statement,
We must use escape character to print the symbol "
The escape character for " is \"
Try the following:

printf(" \"n\"");

Tried and tested :)

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions