Difference between ; and , in for loop
- To: mathgroup at smc.vnet.net
- Subject: [mg113917] Difference between ; and , in for loop
- From: graser <graser at gmail.com>
- Date: Thu, 18 Nov 2010 07:03:57 -0500 (EST)
Hi Mathematica Group, Would anyone explain me the difference between ; and , in conditional loop like for loop? For example, 1) For[i = 1, i < 2, i++; Print[i]] Answer is 2 But 2) For[i = 1, i < 2, i++, Print[i]] The Answer is 1 Why does first loop get 2 instead of 1? Thanks!