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

Explore more Topics under C Programming

Q131.
What is the output of this C code (considering sizeof char is 1 and pointer is 4)?
#include <stdio.h>
    int main()
    {
        char *a[2] = {"hello", "hi"};
        printf("%d", sizeof(a));
        return 0;
    }

a.

9

b.

4

c.

8

d.

10

Discuss
Answer: (c).8
Q132.
What is the output of this C code?
#include <stdio.h>
    int main()
    {
        char a[2][6] = {"hello", "hi"};
        printf("%d", sizeof(a));
        return 0;
    }
Discuss
Answer: (b).12
Q133.
What is the output of this C code?
#include <stdio.h>
    int main()
    {
        char a[2][6] = {"hello", "hi"};
        printf("%s", *a + 1);
        return 0;
    }
Discuss
Answer: (c).ello
Q134.
What is the output of this C code?
#include <stdio.h>
    int main()
    {
        char *a[2] = {"hello", "hi"};
        printf("%s", *(a + 1));
        return 0;
    }
Discuss
Answer: (c).hi
Q135.
Advantage of a multi-dimension array over pointer array
Discuss
Answer: (d).All of the mentioned
Q136.
Which of the following operation is possible using a pointer char?
(Assuming declaration char *a;)
Discuss
Answer: (c).Changing address to point at another location
Q137.
Comment on the following two operations?
int *a[] = {{1, 2, 3}, {1, 2, 3, 4}}; //- 1
int b[4][4] = {{1, 2, 3}, {1, 2, 3, 4}};//- 2
Discuss
Answer: (c).1 won’t work, 2 will work
Q138.
Comment on the following two operations?
int *a[] = {{1, 2, 3}, {1, 2, 3, 4}}; //- 1
int b[][] = {{1, 2, 3}, {1, 2, 3, 4}}; //- 2
Discuss
Answer: (d).Neither of them work
Q139.
What does argv and argc indicate in command-line arguments?
(Assuming: int main(int argc, char *argv[]) )
Discuss
Answer: (b).argument count, argument vector
Q140.
Which of the following syntax is correct for command-line arguments?

a) int main(int var, char *varg[])
b) int main(char *argv[], int argc)
c) int main()
{
int argv, char *argc[];
}
d) none of the mentioned

a.

a

b.

b

c.

c

d.

d

Discuss
Answer: (a).a

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!