

InterviewSolution
Saved Bookmarks
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
1. |
Can a structure can point to itself? |
Answer» A structure pointing to itself is called self-referential structures. | |
2. |
Is there easy way to print enumeration values symbolically? |
Answer» You can write a function of your own to map an enumeration constant to a string. | |
3. |
Bit fields CANNOT be used in union. |
Answer» The following is the example program to explain "using bit fields inside an union". #include<stdio.h> union Point { unsigned int x:4; unsigned int y:4; int res; }; int main() { union Point pt; pt.x = 2; pt.y = 3; pt.res = pt.y; printf("\n The value of res = %d" , pt.res); return 0; } // Output: The value of res = 3 | |
4. |
What will be the output of the program in 16 bit platform (Turbo C under DOS) ? |
Answer» Since C is a compiler dependent language, in Turbo C (DOS) the output will be 2, but in GCC (Linux) the output will be 4. | |
5. |
Point out the error in the program? |
Answer» At run time it will show an error then program will be terminated. Sample output: Turbo C (Windows) c:\>myprogram Sample 12.123 scanf : floating point formats not linked Abnormal program termination | |