Multiple choice technology programming languages

What will be the output of following code segment? #include int main() {     int num,a=5;     num=-a--;     printf("%d  %d",num,a); }

  1. 5,4

  2. -4,4

  3. -5,4

  4. -4,5

  5. Compilation Error

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The post-decrement operator a-- returns the current value (5) before decrementing a to 4. Unary minus is then applied to the returned value (5), giving -5. So num = -5, a = 4, output is "-5 4".