Subj : Re: which for loop is better? To : comp.programming.threads From : David Hopwood Date : Fri Mar 25 2005 03:06 am sam wrote: > Hi, > which one of the following codes in C would you prefer to print > those "hello"s and why? > int i,j; > 1) for(i=0;i<=99;i++) > for(j=0;j<=999;j++) > printf("hello"); > > 2) for(i=0;i<=999;i++) > for(j=0;j<=99;j++) > printf("hello"); As if it matters. What a stupid question, teaching people to micro-optimize without thinking about whether it can possibly lead to any difference in perceptible performance. Whoever set this homework question should be ashamed of themselves. -- David Hopwood .