Sam Powell - ti 83/84 programs - Math/Computer Teacher - Northridge H.S. - Middlebury Indiana |Programming Page |TI 83/84 Programs |mrpowell.net |

TI 83/84 - Post test Loop


Purpose : This program will illustrate a post test loop. The loop was designed to count and output each pass through the loop. It will exit the loop once it counts to five, but will not output the five. Use this type of loop when you don’t know precisely how many times you will pass through the loop but you do know that you will pass through at least once.

ClrHome
equation1                                              /initializing K=0
Lb1 1                                                /Start of Loop – attaching a label
Output(K+1, 1, K)                            /Ouputs [down K+1, right K, variable K)
equation2                                       /stores the value of K+1 into K thus counts the passes through the loop.
If K<5                                               //If k<5 then goto Label 1 (Lbl 1) otherwise bump out of loop
Then
Goto 1                                             
End                                                   /End loop

 

Output

0
1
2
3
4