union
{
char ch[10];
short s;
}test;
test.s = 0xabcd;
main()
{
printf("%d",ch[10]);
}
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
What is the meaning of && in c?
There are 21 people in a room. They have to form groups of 3 people each. How many combinations are possible? Write a C program to print the same.
char S; char S[6]= " HELLO"; printf("%s ",S[6]); output of the above program ? (0, ASCII 0, I,unpredictable)
Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.
could u able to tell about suresoft technical session
character array A[12] can hold
dibakar & vekatesh..uttejana here..abt ur reply for in place reversal of linked list..wats p stands for there?
Write a program to swap two numbers without using a temporary variable?
What is getch() function?
5. What kind of sorting is this: SORT (k,n) 1.[Loop on I Index] repeat thru step2 for i=1,2,........n-1 2.[For each pass,get small value] min=i; repeat for j=i+1 to N do { if K[j]<k[min] min=j; } temp=K[i];K[i]=K[min];K[min]=temp; 3.[Sorted Values will be returned] A)Bubble Sort B)Quick Sort C)Selection Sort D)Merge Sort
how do you write a function that takes a variable number of arguments? What is the prototype of printf () function?
What is page thrashing?