Software Engineering
Accenture PrimermediumSoftware Engineering05 Arrays

Assume you have an array5 nam2ed n2umb4ers 8of size 10. Which of the assignment is valid?

Answer options

A
numbers[0] <- 10
B
numbers[10] <- 11
C
numbers[9] <- 5
D
numbers[11] <- 6

Correct answer: numbers[0] <- 10, numbers[9] <- 5

Explanation

array index starts from 0 to 9, for 10 elements. Assigning values to numbers[10],numbers[11] is not valid, since the index exceeds the size of array resulting in unpredictable results

Related Accenture Software Engineering questions

Practice more Accenture Software Engineering questions

PrimerDumps has 1400+ primer questions, 2026 mocks and coding hands-on — all free.