What would be the values of a, b and c after these statements executes
c=1;
a=c++;
b=++c;
Answers
Answered by
2
Here a = 1
and b = 2
Explanation:
In first case a=c++, the value of c will be assigned in a because precedence of = is higher than postfix ++.
In second case b= ++c so it will increment the value of c and then it will be assigned in b.
Because precedence of prefix ++ is more than = operator.
Hope it helps...
Similar questions
Social Sciences,
1 month ago
Hindi,
2 months ago
Social Sciences,
2 months ago
Computer Science,
9 months ago
Math,
9 months ago