what is function of ++ after or before an integer | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

what is function of ++ after or before an integer

what is function of ++ after or before an integer in code

17th Jun 2016, 12:15 PM
mahmoud
2 Answers
+ 2
it increments the value of ur variable by 1. if x=3 and x++ gives 4. ++x is pre increment and x++ is post increment.
17th Jun 2016, 12:26 PM
Sardor
Sardor - avatar
+ 1
int a=3,b; b=a++ then cout<<b----->output is 3 but b=++athen cout<<b------>output is 4
17th Jun 2016, 1:32 PM
Manikanta Kottakota
Manikanta Kottakota - avatar