+ 1
Output for the code
int f=1, i=2; while(++i<5) { f*=i; } cout<<f;
5 Antworten
+ 5
12//use code playground
+ 5
I think it's quiz question Scooby
+ 5
The increment operator shown above is preincrement operator it means the value of variable i will be increased first then it's value is compared with 5 in while loop
During first iteration i's value will be increment by 1 so i will be 3 then it's value will be compared with 5. The loop will run and value of f becomes 3 cuz 1*3
During second iteration the value of I will be incremented to 4 then compared with 5 and loop will execute and f will be 12 cuz 3*4
So the answer will be 12.👍
0
12.
0
12