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

Explore more Topics under C Programming

Q101.
What is the correct syntax to send a 3-dimensional array as a parameter?
(Assuming declaration int a[5][4][3];)
Discuss
Answer: (a).func(a);
Discuss
Answer: (d).All of the mentioned
Q103.
What is the output of this C code?
#include <stdio.h>
    int main()
    {
        int ary[2][3];
        foo(ary);
    }
    void foo(int *ary[])
    {
        int i = 10, j = 2, k;
        ary[0] = &i;
        ary[1] = &j;
        *ary[0] = 2;
        for (k = 0;k < 2; k++)
        printf("%d\n", *ary[k]);
    }
Discuss
Answer: (a).2 2
Q104.
What is the output of this C code?
#include <stdio.h>
    int main()
    {
        int ary[2][3];
        foo(ary);
    }
    void foo(int (*ary)[3])
    {
        int i = 10, j = 2, k;
        ary[0] = &i;
        ary[1] = &j;
        for (k = 0;k < 2; k++)
        printf("%d\n", *ary[k]);
    }
Discuss
Answer: (a).Compile time error
Q105.
What is the output of this C code?
#include <stdio.h>
    int main()
    {
        foo(ary);
    }
    void foo(int **ary)
    {
        int i = 10, k = 10, j = 2;
        int *ary[2];
        ary[0] = &i;
        ary[1] = &j;
        printf("%d\n", ary[0][1]);
    }
Discuss
Answer: (d).Undefined behaviour
Q106.
What is the output of this C code?
#include <stdio.h>
    int main()
    {
        int ary[2][3][4], j = 20;
        ary[0][0] = &j;
        printf("%d\n", *ary[0][0]);
    }
Discuss
Answer: (a).Compile time error
Q107.
What is the output of this C code?
#include <stdio.h>
    int main()
    {
        int ary[2][3];
        ary[][] = {{1, 2, 3}, {4, 5, 6}};
        printf("%d\n", ary[1][0]);
    }
Discuss
Answer: (a).Compile time error
Q108.
To declare a 3 dimension array using pointers, which of the following is the correct syntax:
Discuss
Answer: (a).char *a[][];
Q109.
Comment on the output of this C code?
#include <stdio.h>
    int main()
    {
        char *a = {"p", "r", "o", "g", "r", "a", "m"};
        printf("%s", a);
    }
Discuss
Answer: (b).Output will be p
Discuss
Answer: (d).All of the mentioned

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!