KnowledgeBoat Logo

Computer Applications

What are the essential parts of a looping control structure?

Java Iterative Stmts

1 Like

Answer

The essential parts of a looping control structure are as follows:

  1. Initialisation — This segment initialises the loop control variable before starting the loop. It is executed only once at the beginning of the loop.
    For example, int counter = 1;
  2. Test-condition — The test-condition is the expression that is evaluated at the beginning of each iteration. Its value determines whether the body of the loop is to be executed (test condition is true) or the loop is to be terminated (test condition is false).
    For example, counter <= 10
  3. Update — This is the increment or decrement operation of the control variable. This operation is performed at the end of each iteration.
    For example, counter++ ;

Answered By

1 Like


Related Questions