MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: What is going on!?!


The For loop does not produce any result, that is - it produces Null. The
space is understood as a multiplication operator by the Mathematica parser.
Thus your result. Put a semicolon after the closing bracket of the For  loop
and you will get what you expect.


On Sat, Nov 7, 2009 at 3:46 AM, Joe Hays <joehays at> wrote:

> Can anyone tell me why the output is not a simple "10" instead of "10
> Null"?
> In[3]:= x = 0;
> For[i = 1, i <= 10, i++,
>  x = x + 1;
>  ] x
> Out[4]= 10 Null

  • Prev by Date: Piecewise with ODE and constant
  • Next by Date: Re: How can I reduce the frequency of a sine wave tia
  • Previous by thread: What is going on!?!
  • Next by thread: Re: What is going on!?!