Computer Science, asked by TbiaSupreme, 1 year ago

What are loops? Explain.

Answers

Answered by Anonymous
2
Hey here is your answer.....

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.

Hope this help you...

Answered by gratefuljarette
1

Loop:

  • Loop is an important feature in a programming language through which we can iterate some piece of code until a given condition is achieved. In programming languages, there are basically three different types of loops are as follows: for, do and while.
  • Example of a loop: when we want to print the odd and even numbers up to 100 when we want the sum of the numbers up to 1000 etc. Working of the loop: If the statement is correct, the iteration takes place and if the statement is not correct, it exits the loop.

Learn more about loop

What is loop and it's uses

https://brainly.in/question/9374007

What is a loop?Name one entry controlled loop.

https://brainly.in/question/2455854

Similar questions