find the value of y if a=3 initially y=a++ + ++a + a;
Answers
Answered by
2
Answer:
11
Explanation:
the prefix (++a) increments the value before running the rest of the statement, while the postfix (a++) increments after running the rest of the statement.
Therefore:
if inital value of a = 3 then a ++ will give you 3 but ++a will be 5 hence
y = a++ + ++a + a will be 3+5+3 = 11
Similar questions