C++ MCQs with answers Page - 110

Here, you will find a collection of MCQ questions on C++. Go through these questions to enhance your preparation for upcoming examinations and interviews.

To check the correct answer, simply click the View Answer button provided for each question.

Have your own questions to contribute? Click the button below to share your MCQs with others!

+ Add Question

A

Admin • 833.24K Points
Coach

Q. Example of___ is Float a [3] = {10.2, 33.4, 44.4}

  • (A) Initializing array
  • (B) Initializing variables
  • (C) Initializing functions
  • (D) None of them

A

Admin • 833.24K Points
Coach

Q. Array containing elements are numbered as 0,1,2,3? these numbers are called

  • (A) Subscripts of the array
  • (B) Index values
  • (C) Members of an array
  • (D) Both A and B

A

Admin • 833.24K Points
Coach

Q. _______ is correctly declares an array?

  • (A) int array;
  • (B) int array[10];
  • (C) array{10};
  • (D) array array[10];

A

Admin • 833.24K Points
Coach

Q. Index number of the last element of an array having 9 elements is _______

  • (A) 9
  • (B) 0
  • (C) 8
  • (D) Programmer-defined

A

Admin • 833.24K Points
Coach

Q. Array is defined as

  • (A) An array is a series of element
  • (B) An array is a series of elements of the same type in contiguous memory locations
  • (C) An array is a series of elements of the same type placed in non-contiguous memory locations
  • (D) None of the mentioned

A

Admin • 833.24K Points
Coach

Q. How we accesses the seventh element stored in array?

  • (A) array[6];
  • (B) array(7);
  • (C) array[7];
  • (D) array;

A

Admin • 833.24K Points
Coach

Q. The memory address of the first element in array is _____

  • (A) array[0];
  • (B) array(2);
  • (C) array[1];
  • (D) array;

A

Admin • 833.24K Points
Coach

Q. Output of the this program will be _____

Code:
#include
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;
}
  • (A) 25
  • (B) 26
  • (C) 27
  • (D) None

A

Admin • 833.24K Points
Coach

Q. Output of this program will be

Code:
#include
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;
}
  • (A) 18
  • (B) 15
  • (C) garbage value
  • (D) compile time error

A

Admin • 833.24K Points
Coach

Q. Output of this program will be

Code:
#include
using namespace std;
int main()
{
char str[5] = “ABC”;
cout << str[3];
cout << str;
return 0;
}
  • (A) ABCD
  • (B) AB
  • (C) ABC
  • (D) None