Monday, July 27, 2009

C programmers! help! what is the code for this?

(this image in different angles using loops only pls..thanks!)





*****


****


***


**


*

C programmers! help! what is the code for this?
wow this is boring





for(y=0; y%26lt;=5; y++)


{


for(x = 5; x%26gt;=0; x--)


{


printf("*");


}


printf("\n");


}
Reply:int i,j;


for (i = 5; i %26gt; 0; --i) {


for (j = i; j %26gt; 0; --j) {


printf("*");


}


printf("\n");


}
Reply:for ( i = 5 ; i %26gt; 0 ; i -- ) {


for ( j = i ; j %26gt; 0 ; j -- ) {


printf ( "*" ) ;


}


printf ( "\n") ;


}


No comments:

Post a Comment