A

Admin • 833K Points
Coach

Q. What will be the output of the following code snippet?

Code:
#include <stdio.h>
union School {
int age, rollNo;
double marks;
};
void solve() {
union School sc;
sc.age = 19;
sc.rollNo = 82;
sc.marks = 19.04;
printf("%d", (int)sizeof(sc));
}
int main() {
solve();
return 0;
}
  • (A) 4
  • (B) 8
  • (C) 16
  • (D) 12
  • Correct Answer - Option(B)
  • Views: 22
  • Filed under category C Programming
  • Hashtags:

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.