State one difference and one similarity between while loop and do-while loop.
84 Likes
Similarity — Both while and do-while are suitable in situations where numbers of iterations is not known.
Difference — while is an entry-controlled loop whereas do-while is an exit-controlled loop
Answered By
52 Likes
Distinguish between while and do-while loop.
What is meant by an infinite loop? Give an example.
Write the program in Java to display the first ten terms of the following series:
0, 1, 2, 3, 6,
1, -3, 5, -7, 9,