i=0; i++*++i=? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

i=0; i++*++i=?

12th Nov 2016, 12:24 PM
ANAND ALABAL
ANAND ALABAL - avatar
3 Answers
+ 3
it is I which is 0 then increment then multiply after that increment then i which is two now so answer 0 as 0*2
12th Nov 2016, 12:37 PM
Sandeep Chatterjee
+ 3
The answer is zero(0). Steps: 1.i++ stays 0 as it is post increment. 2.i value becomes 1 3.++i becomes 2 as it is pre increment. 4.so the machine executes it as 0*2 5. Machine returns answer as 0 😀😀 Happy coding! : )
12th Nov 2016, 12:45 PM
Rishav Choudhuri
+ 2
0
12th Nov 2016, 4:23 PM
Baraa AB
Baraa AB - avatar