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”.