πŸ“Š C Programming
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
πŸ’¬ Discuss
βœ… Correct Answer: (B) 8

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
257
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Manisha Agrawal
Publisher
πŸ“ˆ
93%
Success Rate