0 votes
in C Plus Plus by
What is the output of the following code?

int main() {

int x = 5;

printf(“%d”, x++);

return 0;

}

A) 5

B) 6

C) 4

D) None of the above

1 Answer

0 votes
by
Answer: A

Explanation: The value of x is first printed using the printf function and then incremented using the ++ operator. Therefore, the output is 5.
...