Puzzle : simple and funny | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 12

Puzzle : simple and funny

int i=1, x=0; x= ++i + ++i + i++ + ++i + i-- + i++; What are the values of x and i at the end ? inspired by Rose Sevenyears if you like the question you can leave a like 🐈

15th May 2017, 6:42 AM
NimWing Yuan
NimWing Yuan - avatar
5 Answers
+ 20
x = 22 i = 5 Solution: // Do it yourself...
15th May 2017, 6:48 AM
Dev
Dev - avatar
+ 5
Hey @nimwing I think you've copied the question from @rose.
15th May 2017, 7:14 AM
Vishnu ks
Vishnu ks - avatar
+ 4
x=22 i=5. Quite good.
15th May 2017, 6:47 AM
Vishnu ks
Vishnu ks - avatar
+ 3
@Vishnu ks It's different and here's my nickname,so I don't mind at all :D P.s. and I copied it from my friend(in real) too :D
15th May 2017, 8:01 AM
Rose Sevenyears
Rose  Sevenyears - avatar
+ 2
oh...:D
15th May 2017, 6:46 AM
Rose Sevenyears
Rose  Sevenyears - avatar