Loop Variable

Why Trust Techopedia

What Does Loop Variable Mean?

In computer programming, a loop variable is a variable that is set in order to execute some iterations of a "for" loop or other live structure.

Advertisements

A loop variable is a classical fixture in programming that helps computers to handle repeated instructions.

Techopedia Explains Loop Variable

Here's how this works — the loop variable is set at a particular integer. Then it's set to increase by one during the length of the loop. When the integer reached reaches the number of desired repeats, the programmer directs the "for" loop to terminate.

So if you have "x equals one" and a "for" loop that operates until x equals five, given an increase of one in each loop iteration, you'll have the operation run five times. That is, depending on where the execution step is in relation to the variable increase.

Traditional programmers are well familiar with loop variables. It's a very simple tool in what has become an incredibly complex world of mathematics and programming syntax.

Advertisements

Related Terms

Margaret Rouse
Technology expert
Margaret Rouse
Technology expert

Margaret is an award-winning writer and educator known for her ability to explain complex technical topics to a non-technical business audience. Over the past twenty years, her IT definitions have been published by Que in an encyclopedia of technology terms and cited in articles in the New York Times, Time Magazine, USA Today, ZDNet, PC Magazine, and Discovery Magazine. She joined Techopedia in 2011. Margaret’s idea of ​​a fun day is to help IT and business professionals to learn to speak each other’s highly specialized languages.