What is the value of len in the following Visual Basic code? Dim strCities() As String = {“Bombay”, “Chennai”, “Ladakh”, “Tamil Nadu”} Dim len As Integer len = strCities.Length()

[amp_mcq option1=”4″ option2=”0″ option3=”3″ option4=”5″ correct=”option1″]

The correct answer is A. 4.

The Length property of a string array returns the number of elements in the array. In this case, the array contains four elements, so the value of len will be 4.

Option B is incorrect because the array is not empty.

Option C is incorrect because the array contains four elements, not three.

Option D is incorrect because the array is not a string, it is a string array.

Exit mobile version