Feed Headline Animator

WAP to find sum of first ten even numbers.

Private Sub Command1_Click()
Dim r As Integer
Dim n As Integer
Dim s As Integer
s = 0
n = 1
Do
r = n Mod 2
If r = o Then s = s + n
n = n + 1
Loop While n <= 10
MsgBox ("Sum of first ten even number is " & s)
End Sub


Posted by: Wasim Javed

No comments:

Post a Comment