What is the value of len in the following Visual Basic code? Dim strVB() As String = {“Sanfoundry”, “Visual Basic”, “VB.Net”, “Visual Studio”} Dim len As Integer len = strVB.Length()

3
5
4
0

The correct answer is C.

The Length() method returns the number of elements in an array. In this case, the array strVB has 4 elements, so the value of len will be 4.

Option A is incorrect because the array strVB has 4 elements, not 3.

Option B is incorrect because the array strVB has 4 elements, not 5.

Option D is incorrect because the array strVB is not empty, so the value of len will not be 0.

Exit mobile version