The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Multiple operations in a "Do" expression
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  

Posts: 18
Registered: 10/29/11
Multiple operations in a "Do" expression
Posted: Nov 26, 2011 4:39 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hello community
I'm learning Mathematica. The expression below just performs one operation. For instructive purposes, what would be the syntax to perform two or more operations with the counter value of the "Do" expression below such as another calculation.

Thanks in advance.

Do[Print[idx," x ",a, " = ", idx*a],{idx,0,3}](*Multiply the loop-counter by the variable "a" here and print*)

0 x 2 = 0
1 x 2 = 2
2 x 2 = 4
3 x 2 = 6

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.