Computer Applications
Convert the following for loop statement into the corresponding while loop and do-while loop:
int sum = 0;
for (int i= 0; i <= 100; i++)
sum = sum + i;
Related Questions
Identify all the errors in the following repetitive statements.
while (x == y) { xx = yy; x = y; }
What are the differences between while loop and do-while loop?
How many times are the following loop bodies repeated? What is the final output in each case?
int x = 1; while (x < 10) if(x % 2 == 0) System.out.println(x);
What is an empty statement? Explain its usefulness.