Computer Science, asked by wwwmridanshika522, 2 months ago

What would be the values of a, b and c after these statements executes
c=1;
a=c++;
b=++c;

Answers

Answered by hiteshgyanchandani6
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