Score higher
Learning anything is easy
Learning on the go
Shop for books and more

# The Repeat . . . End and For . . . End Commands on the TI-84

The TI-84 Plus calculator can handle three looping commands (While . . . End, Repeat . . . End, and For . . . End). The While . . . End and Repeat . . . End commands are similar, but opposite. They are similar because they have the same structure.

And they are opposite because the While . . . End command executes a block of commands while the specified condition is true, whereas the Repeat . . . End command executes a block of commands until the specified condition is true.

## The Repeat . . . End command

In a Repeat . . . End command, if the condition following the Repeat command is false, the program executes the commands between Repeat and End and then returns to the Repeat command to see whether the condition following it is still false.

If it is, the program will again execute the commands between Repeat and End and then return to the Repeat command to see whether the condition following it is still false. If the condition following the Repeat command is true, the program skips the commands between Repeat and End and then moves on to the next command in the program.

Refer to the third screen for an example of using the Repeat . . . End command.

## The For . . . End command

The structure of the For . . . End command appears in the first screen. When the For command is first encountered by your program, it assigns the variable var the value in Start and then executes the commands appearing between For and End (Commands 1).

It then adds the increment inc to the variable var. If var is less than or equal to the value in Stop, the process is repeated. If it isn’t, the program moves on by executing the command appearing after End (Command 2).

An example of using the For . . . End command appears in the second screen. The results of executing this program appear in the third screen in this figure.