A

Admin • 833K Points
Coach

Q. What is the value of x after this code runs?

Code:
#include <stdio.h>
int main() {
int x = 5;
x *= 2 + 3;
printf("%d", x);
return 0;
}
  • (A) 25
  • (B) 10
  • (C) 15
  • (D) Error
  • Correct Answer - Option(A)
  • Views: 21
  • Filed under category C Programming
  • Hashtags:

Explanation by: Admin

Expression is evaluated as x *= (2 + 3), i.e., x = 5 * 5 = 25.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.