Increment decrement | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Increment decrement

a=2,b b=a++ + ++a + a++*a+a; cout«a; the answer of this is - 5 how???

17th Oct 2016, 5:16 AM
Sakshi bissa
2 Answers
+ 1
Here is a video I made to help. C++ Increment and Decrement Explained Simply in 6 Minutes Order of Coding Operations https://youtu.be/GQQFCFWWnaA
6th Feb 2017, 2:37 PM
Amber Nestor Gregory
Amber Nestor Gregory - avatar
- 1
b=2[a+1=3]+[a+1=4]4+(4[a+1=5]*5)+5 b=31 a=5
17th Oct 2016, 6:52 AM
marcram