Message Boards Message Boards

0
|
4753 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

What's wrong with my silly program? I'm stuck though using MMA since ...1.1

Hello all , What is really wrong in this "program" (apart my brain) ? Why the Null return? Merci :) JMC

Attachments:

It's missing a semi-colon after the For loop.

In[1]:= f[n_] := Module[{i, s = 0},
  For[i = 1, i <= 100, i++, s = s + 1/i^n];
  s  
  ]

In[2]:= f[2]

Out[2]= 15895086941330378731122979285175538597023834985437098598894328\
34803818131090369901/\
9721861444343810305896579766726231441619755839957462417827203547055179\
86165248000
POSTED BY: Frank Kampas
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract