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

Explore more Topics under C Programming

Q51.
Comment on the output of this C code?
#include <stdio.h>
    int main()
    {
        int *p = (int *)2;
        int *q = (int *)3;
        printf("%d", p + q);
    }
Discuss
Answer: (d).Compile time error
Q52.
Which of the following operand can be applied to pointers p and q?

(Assuming initialization as int *a = (int *)2; int *b = (int *)3;)
Discuss
Answer: (b).a โ€“ b
Q53.
What is the size of *ptr in a 32-bit machine, (assuming initialization as int *ptr = 10;)?

a.

1

b.

2

c.

4

d.

8

Discuss
Answer: (c).4
Q54.
Which of following logical operation can be applied to pointers?
(Assuming initialization int *a = 2; int *b = 3;)
Discuss
Answer: (d).None of the mentioned
Q55.
What is the output of this C code?
#include <stdio.h>
    void main()
    {
        char *s = "hello";
        char *p = s;
        printf("%c\t%c", *(p + 1), s[1]);
    }
Discuss
Answer: (d).e e
Q56.
What is the output of this C code?
#include <stdio.h>
    void main()
    {
        char *s = "hello";
        char *p = s;
        printf("%c\t%c", *p, s[1]);
    }
Discuss
Answer: (d).h e
Q57.
What is the output of this C code?
#include <stdio.h>
    void main()
    {
        char *s = "hello";
        char *n = "cjn";
        char *p = s + n;
        printf("%c\t%c", *p, s[1]);
    }
Discuss
Answer: (b).Compile time error
Q58.
What is the output of this C code?
#include <stdio.h>
    void main()
    {
        char *s = "hello";
        char *p = s * 3;
        printf("%c\t%c", *p, s[1]);
    }
Discuss
Answer: (c).Compile time error
Q59.
What is the output of this C code?
#include <stdio.h>
    void main()
    {
        char *s= "hello";
        char *p = s + 2;
        printf("%c\t%c", *p, s[1]);
    }
Discuss
Answer: (a).l e
Q60.
What is the output of this C code?
#include <stdio.h>
    int main()
    {
        void *p;
        int a[4] = {1, 2, 3, 8};
        p = &a[3];
        int *ptr = &a[2];
        int n = p - ptr;
        printf("%d\n", n);
    }
Discuss
Answer: (b).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!