निम्नलिखित कोड का आउटपुट क्या होगा?
What will be the output of the following code?
void main()
{
int x = 5*6/2 +8;
printf("%d",x);
return 0;
}
A
20
B
21
C
23
D
19
Explanation
Let's break down the code step by step:
Code:
void main()
{
int x = 5*6/2 + 8;
printf("%d", x);
return 0;
}
Step-by-step calculation:
- 5 * 6 gives 30.
- 30 / 2 gives 15.
- 15 + 8 gives 23.
So, the value of x will be 23.
Thus, the output of the program will be:
(C) 23.
Correct Answer: C) 23