Private Sub Command1_Click()
Dim a() As Integer
Dim i, n As Integer
Dim sum As Integer
sum = 0
n = InputBox("Enter the size of array")
Print "The size of array is" & n
ReDim a(n) As Integer
Print "The contents of array are"
For i = 1 To n
a(i) = InputBox("Enter array elements")
Print a(i)
sum = sum + a(i)
Next i
Print "The sum of array elements is" & sum
End Sub
Private Sub Command2_Click()
End
End Sub
Dim a() As Integer
Dim i, n As Integer
Dim sum As Integer
sum = 0
n = InputBox("Enter the size of array")
Print "The size of array is" & n
ReDim a(n) As Integer
Print "The contents of array are"
For i = 1 To n
a(i) = InputBox("Enter array elements")
Print a(i)
sum = sum + a(i)
Next i
Print "The sum of array elements is" & sum
End Sub
Private Sub Command2_Click()
End
End Sub
No comments:
Post a Comment