adplus-dvertising

Welcome to the Pointers,Arrays and Structures in C++ MCQs Page

Dive deep into the fascinating world of Pointers,Arrays and Structures in C++ with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Pointers,Arrays and Structures in C++, a crucial aspect of Object Oriented Programming Using C++. In this section, you will encounter a diverse range of MCQs that cover various aspects of Pointers,Arrays and Structures 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 Object Oriented Programming Using C++.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Pointers,Arrays and Structures in C++. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of Object Oriented Programming Using C++.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Pointers,Arrays and Structures in C++. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Pointers,Arrays and Structures in C++ MCQs | Page 2 of 17

Q11.
Which of the following correctly declares an array?
Discuss
Answer: (a).int array[10];
Q12.
What is the index number of the last element of an array with 9 elements?
Discuss
Answer: (b).8
Discuss
Answer: (a).An array is a series of elements of the same type in contiguous memory locations
Q14.
Which of the following accesses the seventh element stored in array?
Discuss
Answer: (a).array[6];
Q15.
Which of the following gives the memory address of the first element in array?
Discuss
Answer: (d).array;
Q16.
What will be the output of this program?
    #include <stdio.h>
    using namespace std;
    int array1[] = {1200, 200, 2300, 1230, 1543};
    int array2[] = {12, 14, 16, 18, 20};
    int temp, result = 0;
    int main()
    {
        for (temp = 0; temp < 5; temp++) 
        {
            result += array1[temp];
        }
        for (temp = 0; temp < 4; temp++)
        {
            result += array2[temp];
        }
        cout << result;
        return 0;
    }
Discuss
Answer: (b).6533
Q17.
What will be the output of the this program?
    #include <stdio.h>
    using namespace std;
    int main ()
    {
        int array[] = {0, 2, 4, 6, 7, 5, 3};
        int n, result = 0;
        for (n = 0; n < 8; n++) {
            result += array[n];
        }
        cout << result;
        return 0;
    }
Discuss
Answer: (d).None of the mentioned
Q18.
What is the output of this program?
    #include <stdio.h>
    using namespace std;
    int main()
    {
        int a = 5, b = 10, c = 15;
        int arr[3] = {&a, &b, &c};
        cout << *arr[*arr[1] - 8];
        return 0;
    }
Discuss
Answer: (d).compile time error
Q19.
What is the output of this program?
    #include <stdio.h>
    using namespace std;
    int main()
    {
        char str[5] = "ABC";
        cout << str[3];
        cout << str;
        return 0;
    }
Discuss
Answer: (a).ABC
Q20.
What is the output of this program?
    #include <stdio.h>
    using namespace std;
    int main()
    {
        int array[] = {10, 20, 30};
        cout << -2[array];
        return 0;
    }
Discuss
Answer: (b).-30
Page 2 of 17

Suggested Topics

Are you eager to expand your knowledge beyond Object Oriented Programming Using C++? 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!