+ 1

Output for the code

int f=1, i=2; while(++i<5) { f*=i; } cout<<f;

20th Jun 2018, 2:21 PM
Snehalathaa Srini
Snehalathaa Srini - avatar
5 Antworten
+ 5
12//use code playground
20th Jun 2018, 2:33 PM
Scooby
Scooby - avatar
+ 5
I think it's quiz question Scooby
20th Jun 2018, 2:37 PM
Charan Leo25
Charan Leo25 - avatar
+ 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.👍
20th Jun 2018, 2:42 PM
Deepak Kumar
Deepak Kumar - avatar
0
12.
20th Jun 2018, 3:55 PM
Dragon Slayer Xavier
Dragon Slayer Xavier - avatar
0
12
20th Jun 2018, 4:49 PM
$¢𝐎₹𝔭!𝐨𝓝
$¢𝐎₹𝔭!𝐨𝓝 - avatar