loop

In computer science, a for-loop (or simply for loop) is a control flow statement for specifying iteration, which allows code to be executed repeatedly. Various keywords are used to specify this statement: descendants of ALGOL use "for", while descendants of Fortran use "do". There are other possibilities, for example COBOL which uses "PERFORM VARYING".
A for-loop has two parts: a header specifying the iteration, and a body which is executed once per iteration. The header often declares an explicit loop counter or loop variable, which 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.
The name for-loop comes from the word for, which is used as the keyword in many programming languages to introduce a for-loop. The term in English dates to ALGOL 58 and was popularized in the influential later ALGOL 60; it is the direct translation of the earlier German für, used in Superplan (1949–1951) by Heinz Rutishauser, who also was involved in defining ALGOL 58 and ALGOL 60. The loop body is executed "for" the given values of the loop variable, though this is more explicit in the ALGOL version of the statement, in which a list of possible values and/or increments can be specified.
In Fortran and PL/I, the keyword DO is used for the same thing and it is called a do-loop; this is different from a do-while loop.

You do not have permission to view the full content of this post. Log in or register now.
  1. O

    Tutorial How to loop your GIFs

    This is useful when you're uploading your favorite gif on PHC. Hidden content
  2. P

    C & C++ While Loop add numbers

    Mga bossing patulong naman dito pag code ng C++. #include <iostream> using namespace std; int main() { int n; cout << "Enter a Number: "; cin >> n; int i = 1; while (i <= n) { cout << i << endl; ++i; } sum = sum + n; cout << endl...
  3. S

    Help Loop Video

    Mga bossing baka meron kayo jang files ng loop vids for bussiness lang po, i lalagay ko lang ung logo sa vids.. thank you
  4. K

    TORAM ONLINE LOOP MQ

    Mga lodi may script ba kayo para dito sa loop mq marami kasi ako nakikita level service na nagmamainquest tapos bilis maglevel
  5. E

    Boot loop solution?

    mga master ano po solution para sa boot loop po iphone xr
  6. A

    Help Samsung A3 Boot loop

    good morning mga ka PHC ask ko lang sa mga nakaranas ng boot loop ni samsung a3 baka may alam kayo jan. nag ffb lang kase ako kanina then biglang nag hang after nung nag off sya at yun nanga na bootloop na
  7. N

    Parang paulit ulit na lang , parang nasa loop ako .

    office bahay , bahay office .. . prang nasa loop ako .. eto atah yung matrix na sinasabi .. parang para makawala ka sa matrix is do something different .. parang halimbawa, mag resign unexpectedly ganun .. bigla alis sa trabaho tapos hanap iba work .. ibang routine ..
  8. Y

    Help Bot paano ko kaya ma loop ito

    print(end="Enter the Size: ") arrSize = int(input()) print("Enter " +str(arrSize)+ " Elements: ") arr = [] for i in range(arrSize): arr.append(input()) print("Enter an Element to Search: ") elem = input() chk = 0 for i in range(arrSize): if elem==arr: index = i chk = 1 break if...
  9. Y

    Patulong pano mag loop ito

    Patulong naman po di ko kase mailoop na uulet siya na pag wala sa list yung number, mag aask ulet Search number nums = [] chk = 0 print(end="How Many Number to Enter ? ") tot = int(input()) print(end="Enter " + str(tot) + " Numbers: ") for i in range(tot): nums.insert(i, int(input())) for...
  10. A

    Pc auto repair loop

    mga ka phc help naman nag aauto repair sya kahit reformat ko hindi sya pumapasok sa windows installation kahit tagalan ko ng cmos battery lahat naka saksak usb lahat ng aalam ko pati palit ng power supply wala parin
  11. T

    Help Update system loop

    Paano po ito ma fix? Pgkatpos mag 100% yung update system mag restart ulit din mag update ulit. Ginawa ko na restart 3 times ayaw pumasok sa recovery mode. Ano pa po kaya other way para maka pasok sa recovery mode or ma uninstall yung deep freeze para ma unfreeze or matapos yung update.
  12. D

    Tutorial Magisk Boot Loop Protector(Magisk Module)

    Magisk Bootloop Protector v1.8.1(10015) | Magisk Module By : HuskyDG When it detects a bootloop, it will Disable all magisk modules. Credits •𝙒ᴇ𝘼ʀᴇ𝙍ᴀᴠᴇɴ𝙎• Hidden content
  13. P

    Help REALME 9t fastboot loop

    kada i rrestart ko bumabalik sa fastboot tas kpag charge ko fastboot pdin dko ma click ung volume button sira kasi up and down sira stuck ganun, sana may alam jan kung paano ma fix ung gantong issue
  14. K

    Ipad down grade, iphone 6 loading recovery loop

    patulong naman po pa ulit ulit lang kasi nag lo load ung recovery in iphone 6 na nabili ko, ang ipad naman sa sobrang tagal sa may ari nakalimutan ang pasword baka naman po maturuan nyo ako. salamat sa tutugon. hindi na dn kasi ako estab kaya bulag ako sa mga hidden tools so as password. sayang...
  15. S

    Help Infinix hot 11s boot loop

    This week lang nahalata ko nagdegrade battery then nagrereboot lang bigla Sunod parang humina na rin processor at yung auto reboot nya nagloloop ng ilang beses bago mag open Now boot loop na talaga, nagsastandby pa naman pag di ko inopen thru pattern pero pag naunlock magrereboot ulit ng ilang...
  16. J

    Help PHYTON LOOP

    Mga paps baka alam nyo po kung paano gawin,paturo po sana ako,badly need po,tia
  17. L

    C & C++ Patulongg mga paps, tama ba to?

    Use a counter named count that has an initial value of 1, a final value of 100, and an increment of 5 #include<iostream> using namespace std; int main() { int count = 1; for (int count = 0; count <= 100;count = count + 5 ) { cout << count <<"\n"; } return...
  18. J

    Help Python Loop

    Mga paps alam niyo po ba kung pano gawin yung ganitong loop sa phyton?papaturo lang po sana,badly need,tia po
  19. J

    Help PYTHON LOOP

    Hi po mga paps ,baka muronong po kayo nito sa phyton,patulong namn po kung papano,badly needed po,tia
  20. A

    Help Closed Loop LED Christmas Lantern with Music

    Hi! Baka po meron dito may alam paano namin maeexecute yung project na binigay samin. Puro lang kasi kami online simulation ng mga lab exercises. Wala pa kaming hands-on experience kaya clueless kami ano po gagawin dito huhu. Project: Closed Loop LED Christmas Lantern with Music Specs...
  21. J

    Help PYTHON LOOP

    Good day po baka alam niyo po kung paano gawin,paturo naman po .tia
  22. T

    C & C++ Loop and ifs

    pa help po sa marunong ang hirap intindihin ol class pa naman
  23. M

    PHP How to create new file html page like google classroom with code using php

    Sa mga expert about sa php sana matulungan nyo ko makagawa ng new file which is pag nakagawa na ako ng form na room makaka create na rin ng new file(.)php with looping sana meron nakaka alam ..thank you in advance :)
  24. M

    Help Pano mafix to

    Pano pp kaya mafix to salamat poooo.
  25. R

    Closed Looping PPT Slides opened in Sharepoint.

    Hi guys alam nyo ba kung pano mag loop ng slides pag naka open sa Sharepoint ? Thank you in advance
  26. C

    Closed Javascript (for loop) changing color from black to yellow

    Hi, I'm new here and I'm also starting to learn programming from scratch (non-IT grad). Hoping to switch career from teaching to programming. HELP! How can I change a 200x200 black image to yellow using Javascript's For Loop? Nalilito kasi ako sa "formula". Eto ang naisip ko. Black is (0,0,0)...
  27. P

    Closed Bootloop

    Myphone agua rio fun Help
Back
Top