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

Explore more Topics under C Programming

Q41.
What is the output of the code given below?
#include <stdio.h>
    int main()
    {
        int ary[4] = {1, 2, 3, 4};
        int *p = ary + 3;
        printf("%d %d\n", p[-2], ary[*p]);
    }
Discuss
Answer: (d).2 somegarbagevalue
Q42.
What is the output of this C code?
#include <stdio.h>
    int main()
    {
        int ary[4] = {1, 2, 3, 4};
        printf("%d\n", *ary);
    }
Discuss
Answer: (a).1
Q43.
What is the output of this C code?
#include <stdio.h>
    int main()
    {
        const int ary[4] = {1, 2, 3, 4};
        int *p;
        p = ary + 3;
        *p = 5;
        printf("%d\n", ary[3]);
    }
Discuss
Answer: (b).5
Q44.
Different ways to initialize an array with all elements as zero are
Discuss
Answer: (d).All of the mentioned
Q45.
The elements in the array of the following code are

int array[5] = {5};
Discuss
Answer: (b).5, 0, 0, 0, 0
Discuss
Answer: (c).int size = 3; int array[size] = {1, 2, 3};
Q47.
An array of similar data types which themselves are collection of dissimilar data type are
Discuss
Answer: (c).Array of Structure
Discuss
Answer: (d).You cannot have an array of void data type
Q49.
What is the output of the code given below?
#include <stdio.h>
    int main()
    {
        int ary[4] = {1, 2, 3, 4};
        int p[4];
        p = ary;
        printf("%d\n", p[1]);
    }
Discuss
Answer: (b).Compile time error
Q50.
What is the output of this C code?
#include <stdio.h>
    int main()
    {
        double *ptr = (double *)100;
        ptr = ptr + 2;
        printf("%u", ptr);
    }
Discuss
Answer: (d).116

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!