google.com, pub-4617457846989927, DIRECT, f08c47fec0942fa0 Learn to enjoy every minute of your life.Only I can change my life.: Write a Visual Basic program to calculate Sum of the Even digits of a given number.

Monday, February 23, 2015

Write a Visual Basic program to calculate Sum of the Even digits of a given number.

 Write a Visual Basic program to calculate Sum of the Even digits of a given number.
Designing window :-
Take the following tools form toolbox in form.




Code:-

Private Sub cmdClear_Click()
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
End Sub

Private Sub cmdSum_Click()
    n = Val(Text1.Text)
    While n > 0
        r = n Mod 10
        n = n \ 10
        If r Mod 2 = 0 Then
            s = s + r
        End If
        Text2.Text = s
    Wend
End Sub

Private Sub cmFxit_Click()
Unload Me
End Sub

Private Sub Form_Activate()
Text1.SetFocus
End Sub

===================================
OUTPUT



शिव भोलेनाथ स्तुति

 जय शिवशंकर, जय गंगाधर, करुणा-कर करतार हरे,   जय कैलाशी, जय अविनाशी, सुखराशि, सुख-सार हरे जय शशि-शेखर, जय डमरू-धर जय-जय प्रेमागार हरे,   जय ...