1.

Which of the following is the correct output for the program given below?

#include<studio.h>
int main()
{
union a
{
short int i;
char ch[1];
};
union a u;
u.ch[0] = 10;
u.ch[1] = 20;
printf("%d %d %d n", u.ch[0], u.ch[1], u.i);
return 0;
}

A. 10 20 5130
B. 5130 10 20
C. 10 20 50
D. None of the above
Answer» B. 5130 10 20


Discussion

No Comment Found

Related MCQs