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

b++ or a++

can someone explain to me how to answer if we meet questions like that(b++ or a++)

20th Jan 2017, 9:02 AM
muhammad mirza mahendra
muhammad mirza mahendra - avatar
6 Answers
+ 2
I think 2
20th Jan 2017, 10:33 AM
muhammad mirza mahendra
muhammad mirza mahendra - avatar
+ 1
what the difference between a++ and ++a? ++a : it means increments then asign the value ex: int a=3; int y=++a; now y = 4 and also a=4 a++ : it means asign then increment the value ex: int a=3; int y=a++; now y=3 and a=4
20th Jan 2017, 3:33 PM
Ahmad Hamdan
Ahmad Hamdan - avatar
+ 1
whatever the a and b values...it will be compiled logically...and the output is 1 or 0... note: a true state is when the variable is not zero..
20th Jan 2017, 4:29 PM
Ahmad S Kanaan
Ahmad S Kanaan - avatar
0
a++ means a=a+1 ,what do you think 2 or 3?
20th Jan 2017, 9:58 AM
Leonida17st
Leonida17st - avatar
0
B++ = B+1 But if you are doing: B=1 C= B++ B will be equal to 2 but C will be equal to 1. As if you are doing : 1) B=1 2) C=B 3) B = B+1
1st Feb 2017, 8:01 PM
Nizar Al Danaf
Nizar Al Danaf - avatar
- 2
Try to be more specific. a++ in general means that the program should increase value of a by one.
20th Jan 2017, 9:07 AM
nej marinkovic
nej marinkovic - avatar