What mean ++a | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
4th Jan 2017, 3:00 PM
giang
giang - avatar
7 Answers
+ 9
pre-increment
4th Jan 2017, 3:08 PM
Valen.H. ~
Valen.H. ~ - avatar
+ 6
increment by one before any operation on it.
4th Jan 2017, 3:10 PM
Nawaj Shareef
Nawaj Shareef - avatar
+ 5
Int a = 5 Int b = ++a It is prefix increament ,The value of a is incremented by 1 then, it returns the value. //output a=6
6th Jan 2017, 8:51 AM
Ahmed Mansour
Ahmed Mansour - avatar
+ 2
this is pre-increment . It increments the value of a and then uses it.
1st Mar 2017, 12:30 AM
Dheshoju Kalyan Kumar
Dheshoju Kalyan Kumar - avatar
+ 1
int a=1 and b=++a then b=2 and a=2
4th Jan 2017, 3:57 PM
Swizz
+ 1
My answer is the same as the rest except I'll tell you about the opposite of prefix. Postfix a++. Postfix returns the current value of a first, then increments a. Its like reading a word left to right, that's the order a++ and ++a are evaluated.
15th Feb 2017, 11:05 PM
Brennan
Brennan - avatar
0
when the operator is placed before the variable (++a) the variable is incremented by 1 before it is used in the expression
14th Jan 2017, 10:23 AM
Nandhini Ganesh
Nandhini Ganesh - avatar