Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   i want code for print format as shown below in C lang. (http://www.go4expert.com/forums/i-code-print-format-shown-c-lang-t22270/)

dhanesh10 31May2010 14:21

i want code for print format as shown below in C lang.
 
*****
****
***
**
*
what is the code to print such format in C language

shabbir 31May2010 16:20

Re: i want code for print format as shown below in C lang.
 
Code:

printf("*****");
printf("****");
printf("***");
printf("**");
printf("*");

This Should do it.

xpi0t0s 1Jun2010 22:00

Re: i want code for print format as shown below in C lang.
 
TMTOWTDI.
Code:

void test21()
{
        int i=0x3039;
        do for (int j=0; j<(i%012); j+=printf("*"));
        while (i/=printf("\n")*012);
}


xpi0t0s 1Jun2010 22:16

Re: i want code for print format as shown below in C lang.
 
And another
Code:

void test22()
{
        int fudge=20;
        char *foo=" I am teh 1337 CHEAT";
        while (fudge--,*foo++)
                putchar((foo[fudge--]-32)?42:10);
}



All times are GMT +5.5. The time now is 03:13.