do I put another set of brackets around that loop to stop the loop
~Rick <[EMAIL PROTECTED]> wrote: At Tuesday 1/29/2008 06:24 PM, you
wrote:
>this gives me an infinite loop.... why? is it missing a bracket someplace
> bob
>
> #include<stdio.h>
>int main()
>{
>int tr=10,r,c,s, o=1;
>
>for(c=1; c<=tr; r++)
>{
>for(c=1;c<=tr- r;c++)
>{
>printf(" ");
>}
>for(c=1;c<=o; s++)
>printf("c");
>printf("\n") ;
>o=o+2;
>}
>
>}
In your third for loop, you are only executing a single statement,
printf("c");
Even if you bracket a few statements, c will always be <= o (they
both stay at 1) so, yes, you are in an infinite loop.
~Rick
>
>---------------------------------
>Be a better friend, newshound, and know-it-all with Yahoo!
>Mobile. Try it now.
>
>[Non-text portions of this message have been removed]
>
>
>
>To unsubscribe, send a blank message to
><mailto:[EMAIL PROTECTED]>.
>Yahoo! Groups Links
>
>
>
---------------------------------
Looking for last minute shopping deals? Find them fast with Yahoo! Search.
[Non-text portions of this message have been removed]