Global Information Lookup Global Information

For loop information


Flow diagram of the following for loop code:
for (i = 0; i < 5; i++)
  printf("*");
The loop will cause five asterisks to be printed.

In computer science a for-loop or for loop is a control flow statement for specifying iteration. Specifically, a for loop functions by running a section of code repeatedly until a certain condition has been satisfied.

For-loops have two parts: a header and a body. The header defines the iteration and the body is the code that is executed once per iteration. The header often declares an explicit loop counter or loop variable. This allows the body to know which iteration is being executed. For-loops are typically used when the number of iterations is known before entering the loop. For-loops can be thought of as shorthands for while-loops which increment and test a loop variable.

Various keywords are used to indicate the usage of a for loop: descendants of ALGOL use "for", while descendants of Fortran use "do". There are other possibilities, for example COBOL which uses PERFORM VARYING.

The name for-loop comes from the word for. For is used as the reserved word (or keyword) in many programming languages to introduce a for-loop. The term in English dates to ALGOL 58 and was popularized in ALGOL 60. It is the direct translation of the earlier German für and was used in Superplan (1949–1951) by Heinz Rutishauser. Rutishauser was involved in defining ALGOL 58 and ALGOL 60.[1] The loop body is executed "for" the given values of the loop variable. This is more explicit in ALGOL versions of the for statement where a list of possible values and increments can be specified.

In Fortran and PL/I, the keyword DO is used for the same thing and it is named a do-loop; this is different from a do-while loop.

  1. ^ Wirth, Niklaus (1973). "Preface". Systematic Programming: An Introduction. pp. xiii. ISBN 0138803692.

and 25 Related for: For loop information

Request time (Page generated in 1.272 seconds.)

For loop

Last Update:

In computer science a for-loop or for loop is a control flow statement for specifying iteration. Specifically, a for loop functions by running a section...

Word Count : 4994

Loop

Last Update:

up loop in Wiktionary, the free dictionary. Loop or LOOP may refer to: Loop (mobile), a Bulgarian virtual network operator and co-founder of Loop Live...

Word Count : 874

The Loop

Last Update:

Look up the Loop in Wiktionary, the free dictionary. The Loop may refer to: The Loop, a 1992 novel by Joe Coomer The Loop, a 1998 novel by Nicholas Evans...

Word Count : 418

In the Loop

Last Update:

In the Loop is a 2009 British satirical black comedy film directed by Armando Iannucci. It is a spin-off from Iannucci's BBC Television series The Thick...

Word Count : 2715

Loop de Loop

Last Update:

"Loop de Loop" is a song written by Teddy Vann and Joe Dong and performed by Johnny Thunder featuring The Bobbettes. It reached No. 4 on the U.S. pop chart...

Word Count : 433

Looping

Last Update:

loop in Wiktionary, the free dictionary. Looping may refer to: Loop (music), a repeating section of sound material Audio induction loop, an aid for the...

Word Count : 186

Infinite loop

Last Update:

In computer programming, an infinite loop (or endless loop) is a sequence of instructions that, as written, will continue endlessly, unless an external...

Word Count : 2613

Inoculation loop

Last Update:

An inoculation loop (also called a smear loop, inoculation wand or microstreaker) is a simple tool used mainly by microbiologists to pick up and transfer...

Word Count : 270

OODA loop

Last Update:

The OODA loop (observe, orient, decide, act) is a decision-making model developed by military strategist and United States Air Force Colonel John Boyd...

Word Count : 532

Closed loop

Last Update:

Closed loop or closed-loop may refer to: Loop (topology) Closed curve A closed feedback loop: Closed-loop transfer function Electronic feedback loop PID...

Word Count : 86

Chicago Loop

Last Update:

The Loop, one of Chicago's 77 designated community areas, is the central business district of the city and is the main section of Downtown Chicago. Home...

Word Count : 7132

Loop gain

Last Update:

control system theory, loop gain is the sum of the gain, expressed as a ratio or in decibels, around a feedback loop. Feedback loops are widely used in electronics...

Word Count : 524

Looper

Last Update:

butterflies Looper (surname), a Dutch-language surname with the meaning "runner" Looper, a (usually electronic) tool for creating music loops Looper, a person...

Word Count : 168

Vertical loop

Last Update:

The generic roller coaster vertical loop, also known as a Loop-the-loop, or a Loop-de-loop, where a section of track causes the riders to complete a 360...

Word Count : 1118

Great Loop

Last Update:

The Great Loop is a system of waterways that encompasses the eastern portion of the United States and part of Canada. It is made up of both natural and...

Word Count : 952

Loop of Henle

Last Update:

In the kidney, the loop of Henle (English: /ˈhɛnli/) (or Henle's loop, Henle loop, nephron loop or its Latin counterpart ansa nephroni) is the portion...

Word Count : 1586

Loop unrolling

Last Update:

Loop unrolling, also known as loop unwinding, is a loop transformation technique that attempts to optimize a program's execution speed at the expense...

Word Count : 3268

A Strange Loop

Last Update:

A Strange Loop is a musical with book, music, and lyrics by Michael R. Jackson, and winner of the 2020 Pulitzer Prize for Drama. First produced off-Broadway...

Word Count : 2474

Strange loop

Last Update:

A strange loop is a cyclic structure that goes through several levels in a hierarchical system. It arises when, by moving only upwards or downwards through...

Word Count : 1927

Time loop

Last Update:

The time loop or temporal loop is a plot device in fiction whereby characters re-experience a span of time which is repeated, sometimes more than once...

Word Count : 1473

Foreach loop

Last Update:

foreach loop (or for-each loop) is a control flow statement for traversing items in a collection. foreach is usually used in place of a standard for loop statement...

Word Count : 4052

Switching loop

Last Update:

A switching loop or bridge loop occurs in computer networks when there is more than one layer 2 path between two endpoints (e.g. multiple connections...

Word Count : 552

Loop antenna

Last Update:

A loop antenna is a radio antenna consisting of a loop or coil of wire, tubing, or other electrical conductor, that for transmitting is usually fed by...

Word Count : 6544

Compulsion loop

Last Update:

compulsion loop or core loop is a habitual chain of activities that will be repeated by the user to cause them to continue the activity. Typically, this loop is...

Word Count : 1721

Sentinel loop

Last Update:

A sentinel loop is a sign seen on a radiograph that indicates localized ileus from nearby inflammation. Simply put, it is the dilation of a segment of...

Word Count : 196

PDF Search Engine © AllGlobal.net