Monday, May 24, 2010

C program to print a particular string for hundred times without any condition statements?

The following program would do the trick.


#include %26lt;stdio.h%26gt;





int c=101;


int f()


{


c=c-1;


c %26amp;%26amp; printf ("The string \t") %26amp;%26amp; f();


return 1;


}


void main()


{f();}





Hope this solves your problem.


-Regards, Rahul

C program to print a particular string for hundred times without any condition statements?
No conditional statements doesn not mean no loops ;)


FOR loop dude!


for (int i=0; i%26lt;399;i++)
Reply:Thats a stupid question. The only solution is to type printf("string"); 400 times.





You get no benefit. Use a damn for loop.
Reply:write this line hundred times


printf("Your string...");

jasmine

No comments:

Post a Comment