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

Q151.
What is the output of this C code (run without any commandline arguments)?
#include <stdio.h>
    int main(int argc, char *argv[])
    {
        printf("%s\n", argv[argc]);
        return 0;
    }
Discuss
Answer: (a).Segmentation fault/code crash
Q152.
What is the output of this C code (run without any commandline arguments)?
#include <stdio.h>
    int main(int argc, char *argv[])
    {
        while (*argv++ != NULL)
        printf("%s\n", *argv);
        return 0;
    }
Discuss
Answer: (a).Segmentation fault/code crash
Q153.
What is the output of this C code (run without any command line arguments)?
#include <stdio.h>
    int main(int argc, char *argv[])
    {
        while (*argv  !=  NULL)
        printf("%s\n", *(argv++));
        return 0;
    }
Discuss
Answer: (b).Executable file name
Q154.
What is the output of this C code(run without any command line arguments)?
#include <stdio.h>
    int main(int argc, char *argv[])
    {
        while (argv != NULL)
        printf("%s\n",  *(argv++));
        return 0;
    }
Discuss
Answer: (a).Segmentation fault/code crash
Q155.
Which function is not called in the following program?
#include <stdio.h>
    void first()
    {
        printf("first");
    }
    void second()
    {
        first();
    }
    void third()
    {
        second();
    }
    void main()
    {
        void (*ptr)();
        ptr = third;
        ptr();
    }
Discuss
Answer: (d).None of the mentioned
Q156.
How to call a function without using the function name to send parameters?
Discuss
Answer: (b).Function pointer
Discuss
Answer: (a).void pass(int (*fptr)(int, float, char)){}
Discuss
Answer: (d).None of the mentioned
Q159.
What is the output of this C code?
#include <stdio.h>
    void first()
    {
        printf("Hello World");
    }
    void main()
    {
        void *ptr() = first;
        ptr++
        ptr();
    }
Discuss
Answer: (c).Illegal application of ++ to void data type & pointer function initialized like a variable
Q160.
What is the output of this C code?
#include <stdio.h>
    int mul(int a, int b, int c)
    {
        return a * b * c;
    }
    void main()
    {
        int (*function_pointer)(int, int, int);
        function_pointer  =  mul;
        printf("The product of three numbers is:%d",
        function_pointer(2, 3, 4));
    }
Discuss
Answer: (a).The product of three numbers is:24

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!