+ 1

See this

line 1. a=5 line 2. ++a=??. line 3. a++=??. what is the value of ++a in line2. and whats the value of a++ in line3.

6th Sep 2017, 7:44 AM
stephen haokip
stephen haokip - avatar
4 Answers
+ 7
it is 6 because line 2 increments value of a// a = 6 now at line 3 the value of is incremented after a is returned so it is 6// a= 6 after this calling a it will be 7 //try to call a it shiuld be 7 https://code.sololearn.com/WBe4Yw69fzWv/?ref=app
6th Sep 2017, 7:52 AM
Lord Krishna
Lord Krishna - avatar
+ 6
1 | a=5 2 | ++a=6 3 | a++=6
6th Sep 2017, 7:55 AM
Amethyst Animion
Amethyst Animion - avatar
+ 5
++ before variable executes ++ before function ++ after variable executes ++ after function
6th Sep 2017, 8:22 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 3
at line 1: a=5 //initialized a at line 2: ++a =6 //increment 1 in value of a at line 3 : a++ = 6// a value will get increment after
6th Sep 2017, 8:38 AM
Prakash P
Prakash P - avatar