I set r to 0, but it gives the same results

Mariano Hevia <[EMAIL PROTECTED]> wrote:                               Check 
the inicial value of the variable r: it is never initialized. Surely,
 its inicial value is unexpected for your porpouse. I may guess you expected
 that 0 is assigned. But there is no gaurantee for a variable defined inside
 { }.
 
 -----Mensaje original-----
 De: [email protected] [mailto:[EMAIL PROTECTED] En nombre de
 Robert Ryan
 Enviado el: Sábado, 16 de Febrero de 2008 02:45 p.m.
 Para: [email protected]
 Asunto: [c-prog] infinite loop
 
 this gives an infinite loop..... Why?
 
 //#include<conio.h>
 #include<stdio.h>
 int main()
 {
 int tr=10,r,c,s, o=1;
 //clrscr();
 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;
 }
 //getch();
 }
 
 ---------------------------------
 Never miss a thing.   Make Yahoo your homepage.
 
 [Non-text portions of this message have been removed]
 
 To unsubscribe, send a blank message to
 <mailto:[EMAIL PROTECTED]>. 
 Yahoo! Groups Links
 
 -- 
 No virus found in this incoming message.
 Checked by AVG Free Edition. 
 Version: 7.5.516 / Virus Database: 269.20.6/1282 - Release Date: 15/02/2008
 07:08 p.m.
 
 
     
                               

       
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.

[Non-text portions of this message have been removed]

Reply via email to