tags:

views:

121

answers:

3

i want print a statement 5 times

without using any loop n should be in a line

+8  A: 
printf("%s %s %s %s %s",s,s,s,s,s);
azram19
A: 

Like this, you mean ?

const char * s = "a statement";

printf("%s %s %s %s %s\n", s, s, s, s, s);
Paul R
NO NO NO That's *SIX* lines! OP said "should be in **a** line" (emphasis added) ;)
FrustratedWithFormsDesigner
Yes, by "n" the OP seems to mean "and".
Andreas Rejbrand
+2  A: 

How about this?

printf("%s",s);printf("%s",s);printf("%s",s);printf("%s",s);printf("%s",s);

It's 5 print statements on one line, and an alternative to the others who used a single print statement!

FrustratedWithFormsDesigner