program
to demonstrate concept of array.
-----------------------------------------code---------------------------------------------------------
-----------------------------------------output----------------------------------------------------
-----------------------------------------code---------------------------------------------------------
Module Module1
Sub Main()
Dim
a(4) As Integer
Dim
sum, i As Integer
System.Console.WriteLine("enter five value")
For i =
0 To 10
a(i) = System.Console.ReadLine()
Next i
For i =
0 To 4
If Not a(i) Mod 2 = 0 Then
sum = sum + a(i)
End
If
Next
System.Console.WriteLine("sum of odd number")
System.Console.WriteLine(sum)
System.Console.ReadKey()
End Sub
End Module-----------------------------------------output----------------------------------------------------
codestrew |
No comments:
Post a Comment