+ 2

I don’t understand...

What does this mean?? Var c = 12 C++ =14 Like this...

2nd Mar 2018, 5:05 PM
Titanium99999
Titanium99999 - avatar
3 Answers
+ 5
your sample will produce an error,you cannot assign a value to an incrementing variable
2nd Mar 2018, 5:39 PM
᠌᠌Code X
᠌᠌Code X - avatar
+ 2
In the first line, it declares a variable c which holds the value 12. This results in it being an int as 12 is a whole number with no decimal points. The second line will result in an error as you cannot set a value to an incremented variable, it just doesn't work out. Assuming that the line was without an assignment operator (=), then c would then be equal to 13 as the post increment operator (variable++), increments the value of the variable by one. Hope this helped!
2nd Mar 2018, 5:13 PM
Faisal
Faisal - avatar
0
It doesn't seem to mean something... The second line is an error btw
2nd Mar 2018, 6:06 PM
Mao
Mao - avatar