Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Loop function with conditions?' topicStudent Support Forum > General > "Loop function with conditions?"

Next Comment >Help | Reply To Topic
Author Comment/Response
James
12/16/12 11:40am

How do a Loop function which is conditional..

I am trying to make a loop function something like

x = y + 2

which has to stop at x = 6.
y is the starting point

I want it to calculate it it like this
y=2

it starts with x = 2 +2 = 4 and since 4<6, y = x
so x = 4 + 2 = 6 , and since 6=6 should the output be 4

How do i do that?




URL: ,

Subject (listing for 'Loop function with conditions?')
Author Date Posted
Loop function with conditions? James 12/16/12 11:40am
Re: Loop function with conditions? Bill Simpson 12/16/12 11:02pm
Re: Loop function with conditions? James 12/17/12 12:16pm
Re: Re: Loop function with conditions? Bill Simpson 12/17/12 8:16pm
Next Comment >Help | Reply To Topic