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.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments