Units

### Unit: Basics Of Structures - Questions and Answers

Practice these Basics Of Structures under C Programming walk-in interview Questions/ examination questions with best tricks and short cuts with solution. Student (candidate) who want to crack the walk in interview, competitive exams and want to find short cuts and tricks to solve questions on Basics Of Structures for following purpose.

– Anyone who is wishing to increase their perfect knowledge of Basics Of Structures of C Programming.
– Anyone who is preparing for aptitude test and increase his in depth aptitude knowledge C Programming specifically Basics Of Structures.
– Anyone who is preparing for interviews (competitive examinations, govt examinations and bank examinations, off-campus or on campus interviews, walk-in interview and company interviews) having questions on Basics Of Structures under C Programming.

– Anyone who is preparing for aptitude test or competitive exam or entrance exam.
– Anyone who is preparing for entrance examinations and other competitive examinations.
– All Experienced, Freshers and Students.

Here is list of Questions and Answers covering all key area of  Basics Of Structures topic of C Programming:

1.

What is the output of this C code?

1. `    #include <stdio.h>`
2. `    struct p`
3. `    {`
4. `        int k;`
5. `        char c;`
6. `    };`
7. `    int p = 10;`
8. `    int main()`
9. `    {`
10. `        struct p x;`
11. `        x.k = 10;`
12. `        printf("%d %d\n", x.k, p);`
13. `    }`

Explanation:

2.

What is the output of this C code(according to C99 standard)?

1. ` #include <stdio.h>`
2. `    struct p`
3. `    {`
4. `        int k;`
5. `        char c;`
6. `        float f;`
7. `    };`
8. `    int main()`
9. `    {`
10. `        struct p x = {.c = 97, .k = 1, 3};`
11. `        printf("%f \n", x.f);`
12. `    }`

Explanation:

3.

User-defined data type can be derived by___________

Explanation:

4.

What is the output of this C code?

1. `    #include <stdio.h>`
2. `    struct`
3. `    {`
4. `        int k;`
5. `        char c;`
6. `    };`
7. `    int main()`
8. `    {`
9. `        struct p;`
10. `        p.k = 10;`
11. `        printf("%d\n", p.k);`
12. `    }`

Explanation:

5.

What is the output of this C code(according to C99 standard)?

1. `    #include <stdio.h>`
2. `    struct p`
3. `    {`
4. `        int k;`
5. `        char c;`
6. `        float f;`
7. `    };`
8. `    int main()`
9. `    {`
10. `        struct p x = {.c = 97};`
11. `        printf("%f\n", x.f);`
12. `    }`

Explanation:

6.

What is the output of this C code?

1. `    #include <stdio.h>`
2. `    struct p`
3. `    {`
4. `        int k;`
5. `        char c;`
6. `        float f;`
7. `    };`
8. `    int p = 10;`
9. `    int main()`
10. `    {`
11. `        struct p x = {1, 97};`
12. `        printf("%f %d\n", x.f, p);`
13. `    }`

Explanation:

7.

What is the output of this C code?

1. `    #include <stdio.h>`
2. `    struct`
3. `    {`
4. `        int k;`
5. `        char c;`
6. `    } p;`
7. `    int p = 10;`
8. `    int main()`
9. `    {`
10. `        p.k = 10;`
11. `        printf("%d %d\n", p.k, p);`
12. `    }`

Explanation:

8.

Which of the following structure declaration will throw an error?

Explanation:

9.

What is the output of this C code(according to C99 standard)?

1. `    #include <stdio.h>`
2. `    struct p`
3. `    {`
4. `        int k;`
5. `        char c;`
6. `        float f;`
7. `    };`
8. `    int main()`
9. `    {`
10. `        struct p x = {.c = 97, .f = 3, .k = 1};`
11. `        printf("%f\n", x.f);`
12. `    }`

Explanation:

10.

Which of the following cannot be a structure member?

Explanation:

11.

Which operator connects the structure name to its member name?

Explanation:

12.

Number of bytes in memory taken by the below structure is

1. `    #include <stdio.h>`
2. `    struct test`
3. `    {`
4. `        int k;`
5. `        char c;`
6. `    };`