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 18 of 53

Explore more Topics under C Programming

Q171.
What is the output of this C code?
#include <stdio.h>
    void main()
    {
        struct student
        {
            int no;
            char name[20];
        };
        struct student s;
        no = 8;
        printf("%d", no);
    }
Discuss
Answer: (b).Compile time error
Q172.
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: (c).hello
Q173.
What is the output of this C code?
#include <stdio.h>
    struct student
    {
        int no = 5;
        char name[20];
    };
    void main()
    {
        struct student s;
        s.no = 8;
        printf("hello");
    }
Discuss
Answer: (b).Compile time error
Q174.
What is the output of this C code?
#include <stdio.h>
    struct student
    {
        int no;
        char name[20];
    };
    void main()
    {
        student s;
        s.name = "hello";
        printf("hello");
    }
Discuss
Answer: (c).Compile time error
Q175.
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("%s", s.name);
    }
Discuss
Answer: (c).Junk
Q176.
What is the output of this C code?
#include <stdio.h>
    struct student
    {
        int no;
        char name[20];
    };
    struct student s;
    void main()
    {
        s.no = 8;
        printf("%s", s.name);
    }
Discuss
Answer: (a).Nothing
Q177.
What is the output of this C code?
#include <stdio.h>
    int main()
    {
        int *((*x)())[2];
        x();
        printf("after x\n");
    }
    int *((*x)())[2]
    {
        int **str;
        str = (int*)malloc(sizeof(int)* 2);
        return str;
    }
Discuss
Answer: (a).Compile time error
Q178.
What is the output of this C code?
#include <stdio.h>
    void (*(f)())(int, float);
    void (*(*x)())(int, float) = f;
    void ((*y)(int, float));
    void foo(int i, float f);
    int main()
    {
        y = x();
        y(1, 2);
    }
    void (*(f)())(int, float)
    {
        return foo;
    }
    void foo(int i, float f)
    {
        printf("%d %f\n", i, f);
    }
Discuss
Answer: (a).1 2.000000
Discuss
Answer: (a).y is pointer to the function which returns pointer to integer array
Q180.
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 = f;
        x();
    }
    void (*(f)())(int, float)
    {
        return foo;
    }
    void foo(int i, float f)
    {
        printf("%d %f\n", i, f);
    }
Discuss
Answer: (a).Compile time error

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!