Single Dimensional Array - Quiz

  • Aint num[6] = { 2, 4, 12, 5, 45, 5 };
  • Bint n{} = { 2, 4, 12, 5, 45, 5 };
  • Cint n{6} = { 2, 4, 12 };
  • Dint n(6) = { 2, 4, 12, 5, 45, 5 };
  • A2
  • B10
  • C20
  • DTheoratically no limit. The only practical limits are memory size and compilers.
  • AThe code is erroneous since the statement declaring array is invalid.
  • BThe code is erroneous since the subscript for array used in for loop is in the range 1 to size.
  • C The code is correct and runs successfully.
  • DThe code is erroneous since the values of array are getting scanned through the loop.