What is the output of the following program? Why? | CPP Interview Questions
#include <stdio.h> main()
{
typedef union
{
inta;
charb[10]; float c;
} Union;
Union x,y= {100}; x.a = 50;
strcpy(x.b,\"hello\"); xc = 21.50;
pnntf(VUnion x : %d %s %f \n\",xa,x.b,x.c ); pnntf(\"Umon y :%d %s%f \n\",y.a,yb,yc); }
Given inputs X, Y, Z and operations | and & (meaning bitwise OR and AND, respectively) What is output equal to in output=(X& Y) | (X&Z) | (Y&Z)
#include <stdio.h> main()
{
typedef union
{
inta;
charb[10]; float c;
} Union;
Union x,y= {100}; x.a = 50;
strcpy(x.b,\"hello\"); xc = 21.50;
pnntf(VUnion x : %d %s %f \n\",xa,x.b,x.c ); pnntf(\"Umon y :%d %s%f \n\",y.a,yb,yc); }
Given inputs X, Y, Z and operations | and & (meaning bitwise OR and AND, respectively) What is output equal to in output=(X& Y) | (X&Z) | (Y&Z)
0 comments:
Post a Comment