if n=5 then what is the value of a? a = n++ in computer science
Answers
Answered by
2
a = 6
n++ increments the value of n by 1
If you use the ++ operator as prefix like: ++var. The value of var is incremented by 1 then, it returns the value.
If you use the ++ operator as postfix like: var++. The original value of var is returned first then, var is incremented by 1.
Similar questions