GeekInterview.com
Series: Subject: Topic:
Question: 441 of 828

HOW TO PRINT "n" in C?

Asked by: Interview Candidate | Asked on: Sep 10th, 2006
Showing Answers 1 - 63 of 63 Answers
Steve

Answered On : Sep 12th, 2006

Printf("n");

  
Login to rate this answer.
deepakcs2001

Answered On : Sep 13th, 2006

View all answers by deepakcs2001

printf(""n"");

  
Login to rate this answer.
ch

Answered On : Sep 13th, 2006

Printf(""n"")

  
Login to rate this answer.
akhilesh

Answered On : Sep 13th, 2006

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

  
Login to rate this answer.
hemant.badhani

Answered On : Sep 15th, 2006

View all answers by hemant.badhani

Printf(""n"");

  
Login to rate this answer.
hemant.badhani

Answered On : Sep 15th, 2006

View all answers by hemant.badhani

It was printf("(backward slash)"n(backward slash)");

  
Login to rate this answer.
ani

Answered On : 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.

  
Login to rate this answer.
yael

Answered On : Sep 18th, 2006

Printf(""""n"""");

  
Login to rate this answer.
jay

Answered On : Sep 23rd, 2006

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

  
Login to rate this answer.
Jitu

Answered On : Sep 25th, 2006

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

  
Login to rate this answer.
pradeep

Answered On : Sep 25th, 2006

printf(""n"");this  works, surely

  
Login to rate this answer.
milind

Answered On : Sep 26th, 2006

printf("n");

  
Login to rate this answer.
hemanth

Answered On : Sep 29th, 2006

Printf(""n"");

  
Login to rate this answer.
ABHAY

Answered On : Oct 11th, 2006

printf(""n"");

  
Login to rate this answer.
Gaurav Kaushik

Answered On : Oct 12th, 2006

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

  
Login to rate this answer.
sanjaya B

Answered On : Oct 13th, 2006

 printf(""n"");

  
Login to rate this answer.
Ramana Babu

Answered On : Dec 4th, 2006

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

  
Login to rate this answer.
Mahendra Kathe

Answered On : Dec 9th, 2006

Nice question , but got cracked hereprintf(""n"");looks strange but definitely works.

  
Login to rate this answer.
rekha123456

Answered On : Apr 23rd, 2007

Void main(){   printf(""""n"""");}orvoid main(){  printf("%c%c%c",34,110,34);}

  
Login to rate this answer.
ardashev

Answered On : Nov 17th, 2007

View all answers by ardashev

I don't get it:on linux with gcc -pedantic printf("n"); works just finewhileprintf("n");means end of linewhats going on ???

  
Login to rate this answer.
kk_indian21c

Answered On : Dec 7th, 2007

View all answers by kk_indian21c

Hey guys try this...i have testedprintf(""n"");Ans: "n"

  
Login to rate this answer.
kk_indian21c

Answered On : Dec 7th, 2007

View all answers by kk_indian21c

Backward slash is not visible does anybody know why???     actually it is printf("(backward slash)"n(backward slash)");

  
Login to rate this answer.
gopitheboss

Answered On : Dec 8th, 2007

View all answers by gopitheboss

Printf("n");

  
Login to rate this answer.
kaushalgoa

Answered On : Dec 18th, 2007

View all answers by kaushalgoa

Printf(""n"");

  
Login to rate this answer.
littlehacker

Answered On : Dec 20th, 2007

View all answers by littlehacker

Hii friends.. 100% correct answer is -  printf(""n"");here u have to use " for printing " thnku

  
Login to rate this answer.
littlehacker

Answered On : Dec 20th, 2007

View all answers by littlehacker

Yess.. it is not visible.. as it is filtered out.. to protect the site from XSS attacks..tats why... we cant see itanyway.. rt answer is..printf("back slash"nbackslash");

  
Login to rate this answer.
winny gupta

Answered On : Jan 4th, 2008

View all answers by winny gupta

It isprintf (""n"");

  
Login to rate this answer.
anil panchal

Answered On : Jan 14th, 2008

View all answers by anil panchal

Printf(""n"");

  
Login to rate this answer.

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);

  
Login to rate this answer.
AkterSuriya

Answered On : Jan 21st, 2008

View all answers by AkterSuriya

It can be printed as printf(""n"");

  
Login to rate this answer.
AkterSuriya

Answered On : Jan 21st, 2008

View all answers by AkterSuriya

It can be printed as printf(""n"");

  
Login to rate this answer.
rajeevdas2000

Answered On : Jan 25th, 2008

View all answers by rajeevdas2000

Printf(""n"");

  
Login to rate this answer.

Printf(""n"");

  
Login to rate this answer.
Amit_21

Answered On : Jan 31st, 2008

View all answers by Amit_21

Use ...printf(""n"");

  
Login to rate this answer.
rabs_aec

Answered On : Feb 2nd, 2008

View all answers by rabs_aec

I thin it is:_printf(""n"");    isit???????

  
Login to rate this answer.
ah.kawasmi

Answered On : Feb 2nd, 2008

View all answers by ah.kawasmi

Printf(""n"");

  
Login to rate this answer.
tour2hell

Answered On : Feb 4th, 2008

View all answers by tour2hell

Printf(""n"");anything that you print after it will be taken as printable char not as a spl char.

  
Login to rate this answer.
rabs_aec

Answered On : Feb 5th, 2008

View all answers by rabs_aec

Printf(""n"");

  
Login to rate this answer.
vanavill

Answered On : Feb 8th, 2008

View all answers by vanavill

         Hai,      printf("n");i think this is the easiest one.

  
Login to rate this answer.
subhro jana

Answered On : Feb 9th, 2008

View all answers by subhro jana

Char a=' " ';printf("%c n %c",a,a);

  
Login to rate this answer.

#include<stdio.h>void main(){ printf(""n"");}

  
Login to rate this answer.
karth500

Answered On : Mar 14th, 2008

View all answers by karth500

Printf("%c%c%c", '"', 'n', '"');

  
Login to rate this answer.
jeyaraj.ck

Answered On : Mar 18th, 2008

View all answers by jeyaraj.ck

printf("  "  n  "  ");

  
Login to rate this answer.
jeyaraj.ck

Answered On : Mar 18th, 2008

View all answers by jeyaraj.ck

printf(" backslash" n backslash" ");backslash is

  
Login to rate this answer.
Nihar Shukla

Answered On : Apr 4th, 2008

View all answers by Nihar Shukla

Hey All,printf(""n""); Will not work !!Only this will work portably across all platforms.printf("%c%c%c",34,110,34);

  
Login to rate this answer.

Printf("nn");

  
Login to rate this answer.

#include<stdio.h>main(){printf("nn");}

  
Login to rate this answer.
aayushkaistha

Answered On : Apr 4th, 2008

View all answers by aayushkaistha

Printf(""n"");in order to print " u need to use the escape sequence ie,"

  
Login to rate this answer.

printf(""n"") ; will work.Here escape sequences are used.

  
Login to rate this answer.
rohansd

Answered On : Apr 12th, 2008

View all answers by rohansd

This works printf(""n"");The escape characters( ) allows printing double quotes.

  
Login to rate this answer.

printf(""n"");write it save it in ur turbo c compiler with extaintion prog.cand run it....

  
Login to rate this answer.

Printf("(backslahs)"n(back slash)"");Write it and save it...as prg.crun it  

Yes  1 User has rated as useful.
  
Login to rate this answer.
keraisureshv

Answered On : May 21st, 2008

View all answers by keraisureshv

Printf(""n"");

  
Login to rate this answer.
paragmalshe

Answered On : May 29th, 2008

View all answers by paragmalshe

Printf(""n"");

  
Login to rate this answer.
geekkirankumar

Answered On : May 29th, 2008

View all answers by geekkirankumar

Printf("n");

  
Login to rate this answer.
spacebat777

Answered On : Jun 3rd, 2008

View all answers by spacebat777

Printf(""n" in Cn");

  
Login to rate this answer.

Hi All,      Here is the executable piece of code, i have tried in linux PC.main(){     printf(""n"");     return 0;}If u have any doubts feel free to mail chandrakala@tataelxsi.co.in.RegardsKala

  
Login to rate this answer.

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

  
Login to rate this answer.
Sukumar Paul

Answered On : Aug 1st, 2010

View all answers by Sukumar Paul

the correct ans is:void main(){        printf(""n"");}

  
Login to rate this answer.
kunnath_divya

Answered On : Sep 11th, 2010

View all answers by kunnath_divya

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 :)

  
Login to rate this answer.
Manan Jadhav

Answered On : May 4th, 2011

View all answers by Manan Jadhav

Printf(""n"");

  
Login to rate this answer.
K.Geethanjali

Answered On : May 17th, 2011

We can print "n" in c by using following statementprintf("n");

Yes  1 User has rated as useful.
  
Login to rate this answer.
pritam.mg

Answered On : Jun 16th, 2011

View all answers by pritam.mg

Printf(""n"");

  
Login to rate this answer.

Give your answer:

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

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.