Site icon Exam4Training

What will be the output of the following code snippet in C: int num = 5; printf("%d", num++);

What will be the output of the following code snippet in C: int num = 5; printf("%d", num++);
A . 4
B . 6
C . 5
D . Undefined

Answer: C

Explanation:

The postfix increment operator (num++) increments the value of num after the current value is used in the printf statement.

Exit mobile version