Ans :
Private sub cmdsort_LostFocus()
For I = 0 To 5
txtCarr(I)Text = Clear
Next
End Sub
Private Sub cmdSort_Click()
Dim I, J As Integer
Dim CArr (4) As String
For I = 0 To 4
CArr(I)= txtCarr(I).Text
Next
For I = 0 To 4
For J = 4 To I + 1 Step -1
If CArr (J) < CArr(J - 1) Then
X = CArr(J)
CArr (J) = CArr(J - 1)
CArr (J - 1) = X
End If
Next
Next
For I = 0 To 4
txtOutput(I).Text = CArr(I)
Next
End Sub
No comments:
Post a Comment