SSC MTS EXAM

SSC

COMPUTER

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
What does a loop do to a section of code?
A
Deletes it
B
Repeats it
C
Reverses it
D
Filters it
Explanation: 

Detailed explanation-1: -With a for loop, we can tell the computer to repeat an instruction so that we don’t need to repeat it in code. A counter variable is used throughout those parts. That variable keeps track of the current repetition, and is typically named i .

Detailed explanation-2: -A repeat loop is used any time you want to execute one or more statements repeatedly some number of times. The statements to be repeated are preceded by one of the repeat statements described below, and must always be followed by an end repeat statement to mark the end of the loop. Repeat loops may be nested.

Detailed explanation-3: -The for loop is used to repeat a section of code known number of times. Sometimes it is the computer that knows how many times, not you, but it is still known.

Detailed explanation-4: -Repetition structures, or loops, are used when a program needs to repeatedly process one or more instructions until some condition is met, at which time the loop ends. Many programming tasks are repetitive, having little variation from one item to the next.

There is 1 question to complete.