Arrays interview questions

20 questions. Tap “Show answer” to check yourself.

Advertisement
  1. ___  function compares the two given strings.

    1. Strcmp ()
    2. Strcp ()
    3. Stcp()
    4. Stcmp()
    Show answer

    A. Strcmp ()

  2. Matrices can be represented through ____ arrays.

    1. Single
    2. 2-D
    3. 3-D
    4. Multi-dimensional
    Show answer

    B. 2-D

  3. The size of the array should always be ___

    1. Positive
    2. Negative
    3. Whole number
    4. Real number
    Show answer

    A. Positive

  4. Character Array should be initialized using ___ quotes.

    1. Any
    2. Double
    3. No
    4. Single
    Show answer

    B. Double

  5. In a 2D array, the first sub-script stands for ____

    1. Row
    2. Column
    3. Object
    4. Diagonal
    Show answer

    A. Row

  6. _____ dimensional array is an array in which each element is itself an array

    1. One
    2. Two
    3. Four
    4. Five
    Show answer

    B. Two

  7. The ____ character is very important, as it acts the string terminator.

    1. Float
    2. Int
    3. Null
    4. String
    Show answer

    C. Null

  8. ____ is a member function of standard input istream.

    1. Getsline ()
    2. Line()
    3. Get ()
    4. Getline ()
    Show answer

    D. Getline ()

  9. String manipulators are defined in __ header file.

    1. string.h
    2. string
    3. st.h
    4. std.h
    Show answer

    A. string.h

  10. Arrays are of ___ types.

    1. 1
    2. 2
    3. 3
    4. 4
    Show answer

    B. 2

  11. ____  parameters are required for write function.

    1. Two
    2. Three
    3. Four
    4. Five
    Show answer

    A. Two

  12. The process of arranging the data in a given array is called ___

    1. Merging
    2. Filtering
    3. Sorting
    4. Ordering
    Show answer

    C. Sorting

  13. Advertisement
  14. The subscript always commences from ___

    1. One
    2. Two
    3. Three
    4. Zero
    Show answer

    D. Zero

  15. A ___ is a collection of variables of the same type that are referenced by a common name.

    1. Program
    2. Array
    3. Constant
    4. Variable
    Show answer

    B. Array

  16. ____ are otherwise called as literals.

    1. Data
    2. Variables
    3. Constants
    4. Strings
    Show answer

    D. Strings

  17. If the elements are stored in row wise manner it is called as ___ order.

    1. Row-major
    2. Column-major
    3. Column
    4. Row
    Show answer

    A. Row-major

  18. _____ Dimensional array comprising of finite homogenous elements.

    1. One
    2. Two
    3. Three
    4. Multi
    Show answer

    A. One

  19. ____ is a member function of standard output stream i.e., ostream.

    1. Reads ()
    2. Writes ()
    3. Print ()
    4. Write ()
    Show answer

    D. Write ()

  20. Which of the following is a derived data type?

    1. Array
    2. Double
    3. Float
    4. Union
    Show answer

    A. Array

  21. Arrays in C++ belong to which of the following data type?

    1. Primitive
    2. User defined
    3. Derived
    4. Basic
    Show answer

    C. Derived

Advertisement