Programming Language › Union in C Language › Question #2716
Single Choice 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,417 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

Explanation

Y will be printed which is ASCII for 89

Share This Question

Challenge a friend or share with your study group.