Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


union
{
char ch[10];
short s;
}test;
test.s = 0xabcd;


main()
{
printf("%d",ch[10]);
}

Answers were Sorted based on User's Feedback



union { char ch[10]; short s; }test; test.s = 0xabcd; main() { printf("%d",..

Answer / shrikant auti

The code written is incorrect......
union
{
char ch[10];
short s;
}test;
test.s = 0xabcd;


main()
{
printf("%d",ch[10]);/*%D CAN'T BE USED FOR CHARACTER
EXTRACTION*/
}

Is This Answer Correct ?    3 Yes 1 No

union { char ch[10]; short s; }test; test.s = 0xabcd; main() { printf("%d",..

Answer / vipul

the program is incorrect bcz in main function %d is used for integer type value and union is same as the structure and there is no return type in the main function thus it will return a charter type value,

Is This Answer Correct ?    0 Yes 0 No

union { char ch[10]; short s; }test; test.s = 0xabcd; main() { printf("%d",..

Answer / maruthi

Answer:it will print the value of test.s because union
allocates memory for the largest sized variable.And 'll get
the value of recently stored variable.

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More C Interview Questions

what is meant by the "equivalence of pointers and arrays" in C?

3 Answers   Satyam,


write a programme to enter some number and find which number is maximum and which number is minimum from enterd numbers.

3 Answers  


What is the explanation for the dangling pointer in c?

0 Answers  


print the table 5 in loops

3 Answers  


i want explaination about the program and its stack reprasetaion fibbo(int n) { if(n==1 or n==0) return n; else return fibbo(n-1)+fibbo(n-2); } main() { fibbo(6); }

2 Answers  


To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9

0 Answers   HCL,


int a=0,b=2; if (a=0) b=0; else b=*10; What is the value of b ?

6 Answers   TCS,


How can I increase the allowable number of simultaneously open files?

1 Answers   ABC,


implement NAND gate logic in C code without using any bitwise operatior.

4 Answers   Alcatel,


44.what is the difference between strcpy() and memcpy() function? 45.what is output of the following statetment? 46.Printf(“%x”, -1<<4); ? 47.will the program compile? int i; scanf(“%d”,i); printf(“%d”,i); 48.write a string copy function routine? 49.swap two integer variables without using a third temporary variable? 50.how do you redirect stdout value from a program to a file? 51.write a program that finds the factorial of a number using recursion?

6 Answers   Amdocs,


Write a program to find given number is even or odd without using any control statement.

2 Answers  


How can I call a function with an argument list built up at run time?

0 Answers  


Categories