Electronics Circuits & Tutorials - Electronics Hobby Projects - A Complete Electronic Resource Centre
Electronics Circuits & Tutorials

Home About us Electronic Tutorials Engineering Hobby Projects Online Dictionaries Contact us
Tutorials
  • Basic/Beginners
  • Intermediate/Advance
  • Microcontrollers
  • Microprocessors
  • Electronics Symbols
  • Electronics Formulas
  • Dictionary of Units

     more....

Dictionaries
  • Electronics Terms
  • Abbreviations
  • Computer Terms
  • Physics Glossary
  • Science Glossary
  • Space & Solar Terms
  • Semiconductor Symbols / Abbreviation
  • Radio Terminology Bibliography

     more....

Projects
  • Engineering Projects
Home > Electronics Tutorials > Online Computer Terms Dictionary > F

Online Computer Terms Dictionary - F

for ==>

for loop

<programming> A loop construct found in many imperative programming 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.

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.

(1999-07-07)

 


Nearby terms: fork « fork bomb « forked « for loop » FORM » FORMAC » FORMAL
 

Discover
  • C/C++ Language Programming Library
  • Electronic Conversions
  • History of Electronics
  • History of Computers
  • Elec. Power Standards
  • Online Calculator and Conversions
  • Electrical Hazards - Health & Safety
  • Datasheets
  • Quick Reference links
  • Electronics Magazines
  • Career in Electronics
  • EMS Post Tracking

     more......

Home Electronic Tutorials Engineering Hobby Projects Resources Links Sitemap Disclaimer/T&C

Copyright © 1999-2020 www.hobbyprojects.com  (All rights reserved)