Module Sum Sub Main() Dim arr() As Integer = {11, 22, 33, 44, 55} Dim i, s As Integer Console.WriteLine("Array Contains...") s = 0 For i = 0 To 4 Console.WriteLine("arr(" & i & ")=" & arr(i)) Next For i = 0 To 4 s += arr(i) Next Console.WriteLine("Reqd Sum=" + s.ToString()) Console.ReadLine() End Sub End Module
No comments:
Post a Comment