State one similarity and one difference between while and for loop.
Question :
State one similarity and one difference between while and for loop.
Similarity: Both while and for loop is used as entry controlled loop.
Difference: The for loop may have initialisation, test expression and updation, written before
the loop. The while loop have the initialisation always before the loop and updation in the body
of the loop.