Dictionary    Maps    Thesaurus    Translate    Advanced >   


Tip: Click Thesaurus above for synonyms. Also, follow synonym links within the dictionary to find definitions from other sources.

1. The Free On-line Dictionary of Computing (30 December 2018)
for loop
for

    A loop construct found in many procedural
   languages which repeatedly executes some instructions while a
   condition is true.

   In C, the for loop is written in the form;

    for (INITIALISATION; CONDITION; AFTER)
      STATEMENT;

   where INITIALISATION is an expression that is evaluated once
   before the loop, CONDITION is evaluated before each iteration
   and the loop exits if it is false, AFTER is evaluated after
   each iteration, and STATEMENT is any statement, including a
   compound statement within braces "..", that is executed if
   CONDITION is true.

   For example:

    int i;
    for (i = 0; i < 10; i++)
    
        printf("Hello\n");
    

   prints "Hello" 10 times.

   Other languages provide a more succinct form of "for"
   statement specifically for iterating over arrays or lists.
   E.g., the Perl code,

    for my $task (@tasks)
    
        postpone($task);
    

   calls function "postpone()" repeatedly, setting $task to each
   element of the "@tasks" array in turn.  This avoids
   introducing temporary index variables like "i" in the previous
   example.

   The for loop is an alternative way of writing a while loop
   that is convenient because the loop control logic is collected
   in a single place.  It is also closely related to the repeat
   loop.

   (2009-10-07)


Common Misspellings >
Most Popular Searches: Define Misanthrope, Define Pulchritudinous, Define Happy, Define Veracity, Define Cornucopia, Define Almuerzo, Define Atresic, Define URL, Definitions Of Words, Definition Of Get Up, Definition Of Quid Pro Quo, Definition Of Irreconcilable Differences, Definition Of Word, Synonyms of Repetitive, Synonym Dictionary, Synonym Antonyms. See our main index and map index for more details.

©2011-2024 ZebraWords.com - Define Yourself - The Search for Meanings and Meaning Means I Mean. All content subject to terms and conditions as set out here. Contact Us, peruse our Privacy Policy