adplus-dvertising

Welcome to the Pointers and Arrays in C MCQs Page

Dive deep into the fascinating world of Pointers and Arrays in C with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Pointers and Arrays in C, a crucial aspect of C Programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of Pointers and Arrays in C, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within C Programming.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Pointers and Arrays in C. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of C Programming.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Pointers and Arrays in C. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Pointers and Arrays in C MCQs | Page 19 of 53

Explore more Topics under C Programming

Q181.
What is the output of this C code?
#include <stdio.h>
    void (*(f)())(int, float);
    typedef void (*(*x)())(int, float);
    void foo(int i, float f);
    int main()
    {
        x p = f;
        p();
    }
    void (*(f)())(int, float)
    {
        return foo;
    }
    void foo(int i, float f)
    {
        printf("%d %f\n", i, f);
    }
Discuss
Answer: (d).Nothing
Discuss
Answer: (b).ptr is pointer to function passing int returning void
Q183.
Which of the following expression is true for the following?

ptr is array with 3 elements of pointer to function returning pointer of int
Discuss
Answer: (b).int *(*ptr[3])();
Discuss
Answer: (b).ptr is a pointer to an int pointer
Discuss
Answer: (a).str is an array of 5 element pointer to type char
Discuss
Answer: (d).Both i) and ii) will work legal and flawlessly
Q187.
What is the output of this C code?
#include <stdio.h>
    struct student
    {
        int no;
        char name[20];
    }
    void main()
    {
        struct student s;
        s.no = 8;
        printf("hello");
    }
Discuss
Answer: (a).Compile time error
Q188.
What is the output of this C code?
#include <stdio.h>
    struct student
    {
        int no;
        char name[20];
    };
    void main()
    {
        student s;
        s.no = 8;
        printf("hello");
    }
Discuss
Answer: (c).Compile time error
Q189.
What is the output of this C code?
#include <stdio.h>
    void main()
    {
        struct student
        {
            int no;
            char name[20];
        };
        struct student s;
        s.no = 8;
        printf("%d", s.no);
    }
Discuss
Answer: (d).8
Q190.
Is the below declaration legal?
int* ((*x)())[2];
Discuss
Answer: (b).False

Suggested Topics

Are you eager to expand your knowledge beyond C Programming? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!