+ 2
Find the output
#include<stdio.h> int main() { Â Â Â Â int a, b = 10; Â Â Â Â a = -b--; Â Â Â Â printf("a = %d, b = %d", a, b); Â Â Â Â return 0; }
2 Answers
+ 6
Just use the sololearn's Code Playground to get the output.
+ 4
In case you already know the output but you are just confused about it:
b-- is postdecrement, i.e.
at first the negative value of b is assigned to a and afterwards b is decremented
if it was
a = -(--b)
the output for a would be -9