union u

{

struct st

{

int i : 4;

int j : 4;

int k : 4;

int l;

}st;

int i;

}u;

main()

{

u.i = 100;

printf("%d, %d, %d",u.i, u.st.i, u.st.l);

}

a. 4, 4, 0

b. 0, 0, 0

c. 100, 4, 0

d. 40, 4, 0



union u { struct st { int i : 4; int j : 4; int k : 4; ..

Answer / guest

c) 100, 4, 0

Is This Answer Correct ?    10 Yes 1 No

Post New Answer

More C Code Interview Questions

Is the following code legal? struct a { int x; struct a *b; }

2 Answers  


Give a one-line C expression to test whether a number is a power of 2.

10 Answers   Microsoft,


main() { int i; float *pf; pf = (float *)&i; *pf = 100.00; printf("\n %d", i); } a. Runtime error. b. 100 c. Some Integer not 100 d. None of the above

2 Answers   HCL, LG,


main(){ char a[100]; a[0]='a';a[1]]='b';a[2]='c';a[4]='d'; abc(a); } abc(char a[]){ a++; printf("%c",*a); a++; printf("%c",*a); }

2 Answers  


how to swap 3 nos without using temporary variable

4 Answers   Satyam,






Program to find the largest sum of contiguous integers in the array. O(n)

11 Answers  


#include"math.h" void main() { printf("Hi everybody"); } if <stdio.h> will be included then this program will must compile, but as we know that when we include a header file in "" then any system defined function find its defination from all the directrives. So is this code of segment will compile? If no then why?

2 Answers  


main() { signed int bit=512, i=5; for(;i;i--) { printf("%d\n", bit = (bit >> (i - (i -1)))); } } a. 512, 256, 128, 64, 32 b. 256, 128, 64, 32, 16 c. 128, 64, 32, 16, 8 d. 64, 32, 16, 8, 4

2 Answers   HCL,


Set up procedure for generating a wire frame display of a polyhedron with the hidden edges of the object drawn with dashed lines

0 Answers   IBM,


print numbers till we want without using loops or condition statements like specifically(for,do while, while swiches, if etc)!

11 Answers   Wipro,


WAP to display 1,2,3,4,5........N

2 Answers  


Is the following code legal? typedef struct a { int x; aType *b; }aType

1 Answers  


Categories