0
How is answer generated to 12?
What is the output of the following code? int f=1, i=2; while(++i<5) { f*=i; } cout<<f;
2 Respostas
+ 8
i=2
i=i+1<5==true&&i==3
f = 3
i=i+1<5==true&&i==4
f = 12
0
the output of this would be 12. each time in a while loop i is incremented by 2 and then checked whether it is less than 5 or not.. and in the loop f*=i; mean f=f*i;