Thanks so much. I didn't realize that the total *= counter; was part of the loop.
Thanks for the clarification. --- satishgitam <[EMAIL PROTECTED]> wrote: > > Hi,in for loop counter is incrementing from 1 to > 'number',every time > counter is multiplying with the value of total and > this value is > storing in the total. > > now take following example. > > your programe is : > > for (int counter = 1; counter <= > number; counter++) > total *= counter; > now let number equal to 3. > Total is initialised to '1'. > > counter number total > 1 3 1 //at > starting of loop > > 1 3 1*1=1 //in first > rotation > > 2 3 1*2=2 //second > rotation > > 3 3 2*3=6 //third > rotation > > when counter is 4 loop breaks,so value of > total is 6 i.e 3!. > > ____________________________________________________________________________________ Now that's room service! Choose from over 150,000 hotels in 45,000 destinations on Yahoo! Travel to find your fit. http://farechase.yahoo.com/promo-generic-14795097
