Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Nesting For loops or While loops' topicStudent Support Forum > General > "Nesting For loops or While loops"

Next Comment >Help | Reply To Topic
Author Comment/Response
Ranga
09/11/03 00:45am

Hello:
I would like to nest For loops, etc such as the following:

For[i=1,i<15,
   first=afttax[[i]],
   For[j=i,j<years,
      b[i,j]=first*(1+int)^j,
      Print[b[i,j]];
   j++],
i++]

Can the above be done? I am getting error messages.

Also can a while or do be nested with For and so on?

thanks for the help

- Ranga

URL: ,

Subject (listing for 'Nesting For loops or While loops')
Author Date Posted
Nesting For loops or While loops Ranga 09/11/03 00:45am
Re: Nesting For loops or While loops Henry Lamb 09/24/03 7:46pm
Next Comment >Help | Reply To Topic