thanks it really helpd me a lot......... On Tue, Aug 2, 2011 at 3:16 AM, Dharmendra Modi < dharmendra.modi...@gmail.com> wrote:
> The first part initialization of for loop (i<=5 && i>=-1) is just an > initialization and nothing else. It is of no use in this case. > > The second part condition holds the condition which is in this case + > +i specifying to run loop till i is non zero. You are using prefix > operator hence it will first increment i and then test. > If you have used i++ the loop wont even have executed single time. > > The condition ++i becomes zero when there is round of short and you > get zero at that time the loop terminates. > > The format specifier for unsigned int is used hence positive values > are printed. > If the format specifier for %d is used then the results would be more > informative. > > Hope that helps. > > On Aug 1, 11:51 pm, jagrati verma <jagrativermamn...@gmail.com> wrote: > > #include<stdio.h> > > main() > > { > > short int i=0; > > for(i<=5 && i>=-1;++i;i>0) > > printf("%u\n",i); > > printf("\n"); > > return 0;} > > > > o/p is 1..... > > 4294967295 hw??????????????????????????? > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.