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

Q21.
What is the output of this C code?
#include <stdio.h>
    int main()
    {
        int i = 11;
        int *p = &i;
        foo(&p);
        printf("%d ", *p);
    }
    void foo(int *const *p)
    {
        int j = 10;
        *p = &j;
        printf("%d ", **p);
    }
Discuss
Answer: (a).Compile time error
Q22.
What is the output of this C code?
#include <stdio.h>
    int main()
    {
        int i = 10;
        int *p = &i;
        foo(&p);
        printf("%d ", *p);
        printf("%d ", *p);
    }
    void foo(int **const p)
    {
        int j = 11;
        *p = &j;
        printf("%d ", **p);
    }
Discuss
Answer: (b).11 11 Undefined-value
Q23.
What is the output of the code below?
#include <stdio.h>
    int main()
    {
        int i = 10;
        int *const p = &i;
        foo(&p);
        printf("%d\n", *p);
    }
    void foo(int **p)
    {
        int j = 11;
        *p = &j;
        printf("%d\n", **p);
    }
Discuss
Answer: (a).11 11
Q24.
Which of the following are correct syntaxes to send an array as a parameter to function:
Discuss
Answer: (a).func(&array);
Q25.
Which of the following can never be sent by call-by-value?
Discuss
Answer: (b).Array
Q26.
Which type of variables can have same name in different function:
Discuss
Answer: (d).Both static variables and Function arguments
Q27.
Arguments that take input by user before running a program are called?
Discuss
Answer: (c).Command-Line arguments
Q28.
The maximum number of arguments that can be passed in a single function are_____________.
Discuss
Answer: (b).253
Q29.
What is the output of this C code?
#include <stdio.h>
    void m(int *p, int *q)
    {
        int temp = *p; *p = *q; *q = temp;
    }
    void main()
    {
        int a = 6, b = 5;
        m(&a, &b);
        printf("%d %d\n", a, b);
    }
Discuss
Answer: (a).5 6
Q30.
What is the output of this C code?
#include <stdio.h>
    void m(int *p)
    {
        int i = 0;
        for(i = 0;i < 5; i++)
        printf("%d\t", p[i]);
    }
    void main()
    {
        int a[5] = {6, 5, 3};
        m(&a);
    }
Discuss
Answer: (b).6 5 3 0 0
Page 3 of 53

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!