C++ Array Important MCQs

C++ Array Important MCQs

C++ Array Important MCQs

  1. _________ is a group of consecutive memory locations with same name and data type.
  2. (a) Loop
    (b) Array
    (c) Function
    (d) Class and Object

    (b) Array

  3. Each element of an array has its own.
  4. (a) Name
    (b) Index
    (c) Size of an Array
    (d) List of Number

    (b) Index

  5. The index of the first element of an array is aloways;
  6. (a) 0
    (b) 1
    (c) -1
    (d) All of these

    (a) 0

  7. Each Element in array has
  8. (a) Name
    (b) Unique Index
    (c) Size of an Array
    (d) List of Number

    (b) Unique Index

  9. Which of the following correct declaration of an array?
  10. (a) int array[10];
    (b) int array[10];
    (c) int array{10};
    (d) INT array[10];

    (b) int array[10];

  11. Object of an array is called as ____________.
  12. (a) Element of an Array
    (b) Index of an Array
    (c) Size of an array
    (d) List of an Array

    (a) Element of an Array

  13. What is the index number of the last element of an array with 50 elements?
  14. (a) 50
    (b) 49
    (c) 51
    (d) None of these

    (b) 49

  15. What is the index number of the first element of an array with 50 elements?
  16. (a) 0
    (b) 1
    (c) -1
    (d) 30

    (a) 0

  17. Which of the following is correct initialization of array?
  18. (a) int arr[2][2] = [1,2,34],[11,22,44],[41,23,24];
    (b) int arr[2][2] = {1,2,34};{11,22,44};{41,23,24};
    (c) int arr[2][2] = {1,2,34},{11,22,44},{41,23,24};
    (d) int arr[2][2] = {1,2,34},{11,22,44},{41,23,24};

    (d) int arr[2][2] = {1,2,34},{11,22,44},{41,23,24};

  19. In the declaration statement int arr[10][6]; the total number of element is?
  20. (a) 61
    (b) 60
    (c) 16
    (d) None of these

    (b) 60

  21. Which of the following functions is used to return the length of a string?
  22. (a) strlen
    (b) stringsize
    (c) stringlen
    (d) None of these

    (a) strlen

  23. Which of the following function is used to copy one string to another string?
  24. (a) strcopy
    (b) stringcopy
    (c) stringcpy
    (d) strcpy

    (d) strcpy

  25. A character constant is written in _______.
  26. (a) Double Quotes
    (b) Single Quotes
    (c) Quote
    (d) None of these

    (b) Single Quotes

  27. What is the output of the following code?
  28. float arr[3] = {5500,3000,202,5605};
    cout<<[1];

    (a) 5500
    (b) 3000
    (c) 8500
    (d) None of these

    (b) 3000

  29. Which of the following functions is used to append a string on to the end of another string?
  30. (a) strcmp
    (b) strlen()
    (c) stringcpy
    (d) strcat()

    (d) strcat()

  31. Which of the following functions is used to compare two string character by character?
  32. (a) strcmp
    (b) stringcompare
    (c) strlen
    (d) None of these

    (a) strcmp

  33. The strcmp() function will return ________ if string 1 is greater than string 2?
  34. (a) 0
    (b) Null
    (c) 1
    (d) -1

    (c) 1

  35. Which of the following function is used to read a string from a keyboard that may contain blank space?
  36. (a) cin.gets()
    (b) cin.get()
    (c) cin.puts()
    (d) None of these

    (b) cin.get()

  37. The strcmp() function will return _______ if string 1 is less than string 2?
  38. (a) 0
    (b) Null
    (c) 1
    (d) -1

    (d) -1

  39. All strings end with special character called __________ character.
  40. (a) Null
    (b) Zero
    (c) 1
    (d) None of these

    (a) Null

  41. The strcmp function will return _______ if string 1 and string 2 are same.
  42. (a) 0
    (b) Null
    (c) 1
    (d) -1

    (a) 0

  43. A string constant is written in ______.
  44. (a) Single Quotes
    (b) Double Quotes
    (c) Without Quotes
    (d) None of these

    (b) Double Quotes

  45. A two dimensional array is always considered as
  46. (a) Linear
    (b) Sequential
    (c) Matrix
    (d) All of these

    (c) Matrix

  47. Which of the following provides the number of bytes occupied by the data type given in the parenthesis?
  48. (a) pow()
    (b) sizeof()
    (c) strcmp
    (d) None of these

    (b) sizeof()

  49. What is output the following code segment?
  50. int Array[5] = {10,20,30,40,60,56};
    cout<<Array[2];

    (a) 20
    (b) 10
    (c) 30
    (d) All of these

    (c) 30

  51. Array is used for :
  52. (a) Array can store a large number of values with single name.
    (b) The use of arrays reduces Program Size.
    (c) A Search Process can be applied an array easily.
    (d) All of these

    (d) All of these

  53. A One Dimensional Array is always considered as
  54. (a) Linear
    (b) List
    (c) Linear/List
    (d) All of these

    (c) Linear/List

  55. One Dimensional Array contains __________ row and _______________ column?
  56. (a) Single Row and Multiple Columns
    (b) 1 row and 2 columns
    (c) Single Row and one Columns
    (d) None of these

    (a) Single Row and Multiple Columns

  57. Two dimensional Array is always considered as
  58. (a) Table
    (b) Matrix
    (c) Table/Matix
    (d) All of these

    (c) Table/Matix

  59. Two dimensional Array contains __________ row and ________ columns?
  60. (a) Multiple Row and Multiple Columns
    (b) 1 Row and 2 Columns
    (c) Single Row and Multiple Columns
    (d) None of these

    (a) Multiple Row and Multiple Columns

  61. Correct Syntax of One Dimensional Array is ____________.
  62. (a) Datatype arrayname[arraysize];
    (b) Datatype arrayname[arraysize];
    (c) Datatype arrayname{arraysize};
    (d) All of these

    (b) Datatype arrayname[arraysize];

  63. Correct Syntax of two dimensional Array is __________.
  64. (a) Datatype arrayname[arraysize];
    (b) .datatype arrayname[columnsize][rowsize];
    (c) datatype arrayname[rowsize][columnsize];
    (d) All of these

    (c) datatype arrayname[rowsize][columnsize];

  65. How many kinds of elements an array can have?
  66. (a) Char and int type
    (b) Only char type
    (c) Only int type
    (d) All of them have same type

    (d) All of them have same type

  67. what does the following code do?
  68. for (int index = 0; index < 5; index++){
    cin >> numbers[index];
    }

    (a) Place data into a four element array called numbers.
    (b) Place data into a four element array called index.
    (c) Place data into a five element array called numbers.
    (d) Place data into a five element array called index.

    (d) Place data into a five element array called index.

  69. what is the last legal subscript that can be used with the following array? Int Values[5];
  70. (a) 4
    (b) 0
    (c) 6
    (d) 5

    (a) 4

  71. every element in an array is searched against some searching key, special for
  72. (a) Linear search
    (b) Bubble sort
    (c) Binary search
    (d) All of them

    (a) Linear search

  73. which of the header file is used for array type manipulation?
  74. (a) <array>
    (b) <type_traits>
    (c) <iostream>
    (d) std namespace

    (d) std namespace

  75. What will be the output of the following C++ code?
  76. #include <iostream>
    #include <string>
    using namespace std;
    int main()
    {
    cout<<rank<int[10]>::value;
    cout<<rank<char[10][10]>::value;
    cout<<rank<string[10][10][10]>::value;
    return 0;
    }

    (a) 400
    (b) 123
    (c) 111
    (d) 200

    (b) 123

  77. Array is a ________ collection of similar data items, by similar we mean that all data items must have the same type
  78. (a) finite
    (b) undefined
    (c) 3 time
    (d) Both a and b

    (a) finite

  79. Array variable can store __________.
  80. (a) More then one value
    (b) store string,integer values
    (c) Both a and b
    (d) None

    (a) More then one value

  81. An array can be a Single Dimensional _________________.
  82. (a) one Subcript Dealing with one Dimensional
    (b) two Subcript
    (c) three Subcript
    (d) None

    (a) one Subcript Dealing with one Dimensional

  83. Array Subcript Start with index no ___.
  84. (a) 1
    (b) 2
    (c) 3
    (d) 0

    (d) 0

  85. The two dimensional (2D) array in C programming is ___________.
  86. (a) matrix
    (b) subcript
    (c) index
    (d) no

    (a) matrix

  87. In Single Dimensional Array ________ is used
  88. (a) single Subcript
    (b) multiple Subcript
    (c) three Subcript
    (d) two Subcript

    (a) single Subcript

  89. In two dimensional array the first subcript of array is ________.
  90. (a) Row
    (b) Column
    (c) Both a and b
    (d) Nobe

    (a) Row

  91. In two dimensional array the second subcript/index of the array is __________.
  92. (a) Row
    (b) Column
    (c) Both a and b
    (d) Nobe

    (b) Column


Related Posts:
C++ Array Important MCQs,itmcqs,com
Related Topics

"C++ Array Important MCQs","cpp array mcqs","c++ array questions and answers pdf","cpp array mcqs","Multiple choice questions and answers on Arrays in C++ MCQs","Arrays C++ MCQ","C++ Arrays Multiple Choice Questions and Answers","cpp array question answers","C++ Array Solved MCQs Questions Answers","Arrays in C++ Multiple Choice Questions and Answers".

Post a Comment

To be published, comments must be reviewed by the administrator.

Previous Post Next Post