Question: Public Class Formi Private Sub Button 1 _ Click ( sender As Object, e As EventArgs ) Handles Button 1 . Click Dim A (

Public Class Formi
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim A() As Integer ={12,11,15,17,3,17,5,14,9,13,11}
Dim i As Integer
Dim j As Integer
Dim x As Integer
x = A(0)
j =0
List1.Items.Clear()
For i =0 To A.Length -1
If x A(i) Then
x = A(i)
j += i
' List1.Items.Add(i & vbTab & j & vbTab & x) ignore this line
End If
Next
' Point 1
" List1.Items.Add(") ignore this line
x = A(A.Length -1)
j = A.Length -1
For i = A.Length -1 To 0 Step -1
If x A(i) Then
x = A(i)
j += i
' List1.Items.Add(i & vbTab & j & vbTab & x) ignore this line
End If
Next
'Point 2
End Sub
End class
How many times the first for-loop is executed?
How many times the first for-loop is executed?
Public Class Formi Private Sub Button 1 _ Click (

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!