Top

Discussion

Pick the best statement for the below program:

#include "stdio.h"
 
int main()
{
 union {int i1; int i2;} myVar = {.i2 =100};
 printf("%d %d",myVar.i1, myVar.i2);
 return 0;
}

 

  • A.Compile error due to incorrect syntax of initialization.
  • B.No compile error and it’ll print “0 100”
  • C.No compile error and it’ll print “100 100”

Answer: C

No answer description available for this question.

No comment is present. Be the first to comment.
Loading…

Post your comment