🚀 Hurry! Offer Ends In
00 Days
00 Hours
00 Mins
00 Secs
Enroll Now
X

निम्नलिखित कोड का आउटपुट क्या होगा?

What will be the output of the following code ?

#include <stdio.h>
void solve() {
int b = 4;
int res = b++ + ++b + ++b;
printf("%d", res);
}
int main() {
solve();
return 0;
}
A
12
B
15
C
17
D
20
Explanation

The expression b++ + ++b + ++b evaluates as follows:

  • b++ uses the value of b (4) and increments it to 5.
  • ++b increments b to 6, then uses it.
  • ++b increments b to 7, then uses it.

So, the sum is 4 + 6 + 7 = 17.

Correct Answer:

(C) 17.

Correct Answer: C) 17

Latest Updates