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 are integer variable, floating-point variable and character variable?

0 Answers  


when to use : in c program?

2 Answers  


The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?

0 Answers  


Why malloc is faster than calloc?

0 Answers  


What is scope rule of function in c?

0 Answers  


Please write the area of a RIGHT ANGLED TRIANGLE.

1 Answers  


hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell

0 Answers   Reliance,


How can I find out if there are characters available for reading?

0 Answers  


enum day = { jan = 1 ,feb=4, april, may} what is the value of may? a)4 b)5 c)6 d)11 e)none of the above

8 Answers   HCL, Wipro,


where do we use volatile keyword?

1 Answers  


How many ways are there to swap two numbers without using temporary variable? Give the each logic.

9 Answers  


A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM

0 Answers   HCL,


Categories