Explanatory Question
Rewrite the following program segment using while instead of for statement.
int f = 1, i;
for(i = 1; i <= 5; i++){
f *= i;
System.out.println(f);
}
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.