Analyse the following java code and write the output for the java program
with explanations [3+2]
a)
Version 1 Version 2
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);
Answers
Answered by
0
Output:
Version 1 - 12
Version 2 - 24
Similar questions