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

#include<stdio.h> main() { struct xx { int x=3; char name[]="hello"; }; struct xx *s=malloc(sizeof(struct xx)); printf("%d",s->x); printf("%s",s->name); }

1 Answers   TCS,


main() { int i, n; char *x = “girl”; n = strlen(x); *x = x[n]; for(i=0; i<n; ++i) { printf(“%s\n”,x); x++; } }

2 Answers  


Print an integer using only putchar. Try doing it without using extra storage.

2 Answers  


#include<stdio.h> main() { struct xx { int x; struct yy { char s; struct xx *p; }; struct yy *q; }; }

1 Answers  


main() { int i=5,j=10; i=i&=j&&10; printf("%d %d",i,j); }

1 Answers  






how to test pierrot divisor

0 Answers  


Write a c program to search an element in an array using recursion

1 Answers   Wipro,


#include<stdio.h> void fun(int); int main() { int a; a=3; fun(a); printf("\n"); return 0; } void fun(int i) { if(n>0) { fun(--n); printf("%d",n); fun(--n); } } the answer is 0 1 2 0..someone explain how the code is executed..?

1 Answers   Wipro,


write the function. if all the character in string B appear in string A, return true, otherwise return false.

11 Answers   Google,


How do you sort a Linked List (singly connected) in O(n) please mail to pawan.10k@gmail.com if u can find an anser...i m desperate to knw...

6 Answers   Microsoft, MSD, Oracle,


#define a 10 void foo() { #undef a #define a 50 } int main() { printf("%d..",a); foo(); printf("%d..",a); return 0; } explain the answer

1 Answers  


main() { int x=5; for(;x!=0;x--) { printf("x=%d\n", x--); } } a. 5, 4, 3, 2,1 b. 4, 3, 2, 1, 0 c. 5, 3, 1 d. none of the above

2 Answers   HCL,


Categories