MCQ Single Best Answer Not Set

QWhat value will be printed for data.c?
#include 
#include 
void main()
{
union Data{
	int i;
	unsigned char c;
}data;

data.c = 'C';
data.i = 89;
printf("%c\n", data.c);

}

ID: #2716 Union in C Language 1,384 views
Question Info
#2716Q ID
Not SetDifficulty
Union in C LanguageTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A C
  • B Y
  • C G
  • D C89
Correct Answer: Option B

Explanation

Y will be printed which is ASCII for 89

Share This Question

Challenge a friend or share with your study group.