Differentiate between the following code fragments and also give their output :-

int f = 1, i = 2;

while (++i < 5)
    f *= i;

System.out.println(f);



int f = 1, i = 2;

do {
    f *= i;
} while (++i < 5);

System.out.println(f);

Single Choice
Views 56

Answer:


Thumbnail

Related Articles:

This section is dedicated exclusively to Questions & Answers. For an in-depth exploration of Java Programming Language, click the links and dive deeper into this subject.

Join Our telegram group to ask Questions

Click below button to join our groups.