Computer Science, asked by veenadass144, 7 months ago

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 Oreki
0

Output:

Version 1 - 12

Version 2 - 24

Similar questions