i) State one similarity and one difference between while loop and for loop.
Answers
Answered by
11
Answer:
for vs while Loop
The while loop is arepetition control structure that executes target statements as long as the given condition is true. The for loop can be used when the number of iterations is known. Thewhile loop can be used when the number of iterations is not known. The initialization occurs once in forloop.
Answered by
8
hey buddy here is your answer
Explanation:
for loop : it is used to execute the statement repeatedly and when condition is true .
in while loop it is as same
difference : for loop : the loop is preferred when number of iterations are fixed.
while loop : the condition is checked at the beginning of the loop
Similar questions