union u

{

union u

{

int i;

int j;

}a[10];

int b[10];

}u;

main()

{

printf("\n%d", sizeof(u));

printf(" %d", sizeof(u.a));

// printf("%d", sizeof(u.a[4].i));

}

a. 4, 4, 4

b. 40, 4, 4

c. 1, 100, 1

d. 40 400 4

Answers were Sorted based on User's Feedback



union u { union u { int i; int j; }a[10]; int ..

Answer / guest

20, 200, error for 3rd printf

Is This Answer Correct ?    3 Yes 2 No

union u { union u { int i; int j; }a[10]; int ..

Answer / psrk

option d

Is This Answer Correct ?    1 Yes 1 No

union u { union u { int i; int j; }a[10]; int ..

Answer / sk

20 200

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Code Interview Questions

abcdedcba abc cba ab ba a a

2 Answers  


#include<stdio.h> main() { int i=1,j=2; switch(i) { case 1: printf("GOOD"); break; case j: printf("BAD"); break; } }

1 Answers  


main() { if (!(1&&0)) { printf("OK I am done."); } else { printf("OK I am gone."); } } a. OK I am done b. OK I am gone c. compile error d. none of the above

3 Answers   HCL,


typedef struct error{int warning, error, exception;}error; main() { error g1; g1.error =1; printf("%d",g1.error); }

1 Answers  


what will be the position of the file marker? a: fseek(ptr,0,SEEK_SET); b: fseek(ptr,0,SEEK_CUR);

2 Answers  






Under linux environment can u please provide a c code for computing sum of series 1-2+3-4+5......n terms and -1+2-3+4-5...n terms..

2 Answers  


Write a prog to accept a given string in any order and flash error if any of the character is different. For example : If abc is the input then abc, bca, cba, cab bac are acceptable, but aac or bcd are unacceptable.

5 Answers   Amazon, Microsoft,


what is the code of the output of print the 10 fibonacci number series

2 Answers  


write a c program to Create a mail account by taking the username, password, confirm password, secret_question, secret_answer and phone number. Allow users to register, login and reset password(based on secret question). Display the user accounts and their details .

2 Answers  


void main() { while(1){ if(printf("%d",printf("%d"))) break; else continue; } }

1 Answers  


C program to print magic square of order n where n > 3 and n is odd

2 Answers   Accenture,


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

3 Answers  


Categories