ALERT

[WEBINAR] See the Whole Story: The Case for a Visualization Platform

Loop

Definition - What does Loop mean?

A loop is a programming function that iterates a statement or condition based on specified boundaries.

The loop function uses almost identical logic and syntax in all programming languages. Thus, a specific statement or a group of instructions is continuously executed until a specific loop body or boundary condition is reached. The result of the entire loop body’s first operation cycle serves as the next repetition’s starting point.

Techopedia explains Loop

A loop repeatedly executes code in its body until the loop conditional statement becomes false.

A loop is divided into two parts:

  • Loop Statement: This defines the time limit to be true for the continuous loop that is contingent on the attached conditional statement.
  • Loop Body: This holds the statement’s code or instruction; it is is executed with each loop cycle.


Here is an example of a loop (a for loop) in C#:

int i; 
string numbers = "";
for (i = 1; i <= 9; i++)
numbers += i.ToString();
Console.WriteLine(numbers);
The output of the example is: "123456789."

Connect with us

Techopedia on Linkedin
Techopedia on Linkedin
Tweat cdn.techopedia.com
"Techopedia" on Twitter


'@Techopedia'
Sign up for Techopedia's Free Newsletter!

Email Newsletter

Join thousands of others with our weekly newsletter

Resources
Free Whitepaper: The Path to Hybrid Cloud
Free Whitepaper: The Path to Hybrid Cloud:
The Path to Hybrid Cloud: Intelligent Bursting To Amazon Web Services & Microsoft Azure
Free E-Book: Public Cloud Guide
Free E-Book: Public Cloud Guide:
This white paper is for leaders of Operations, Engineering, or Infrastructure teams who are creating or executing an IT roadmap.
Free Tool: Virtual Health Monitor
Free Tool: Virtual Health Monitor:
Virtual Health Monitor is a free virtualization monitoring and reporting tool for VMware, Hyper-V, RHEV, and XenServer environments.
Free 30 Day Trial – Turbonomic
Free 30 Day Trial – Turbonomic:
Turbonomic delivers an autonomic platform where virtual and cloud environments self-manage in real-time to assure application performance.