Question 13

Running time of a 'for' loop is ______ the running time of the statements inside the for loop times the number of iterations.

  1. AAtleast
  2. BAtmost
  3. CEqual to
  4. DIndependent of
Show answerHide answer

Correct answer: (B) Atmost

Explanation

The loop body runs once per iteration, so the loop's running time is at most the time of the statements inside it (including the test) multiplied by the number of iterations.

From DSSSB TGT Computer Science Practice Set 5

This is question 13 of DSSSB TGT Computer Science Practice Set 5. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.