What are the three components of a for-loop?

What are the three components of a for-loop?
A. initialization, conditional, increment/decrement
B. conditional, memory allocation, memory deletion
C. reset, increment, conditional
D. reset, increment/decrement, memory allocation
 
Answer: A
Explanation: The for-loop structure is an entry controlled looping structure. It is generally used when there is a clear starting point and ending point to the loop. Unlike the while loop in which the ending point may or may not be included in the loop structure.
 

Tìm kiếm

Back
Top