Walk Lightly on this PLANET and yet leave such a FOOTPRINT that cannot be erased for thousands of Years..!!!
Visit Codstech for Cyber Security related Posts !

Visitors

Wednesday, July 13, 2011

VB-39 : Find the integer is odd or even.

Write an event procedure to collect an integer from the user and find out whether the given integer is an odd or an even one. Design a splash screen for this application. Use appropriate controls on the form.


Compare this program with the JAVA program. 

Odd or Even checking in JAVA


A)   Program Design : 




(B) Property(Controls Used) :
  •      2 Labels - Captions are Enter an integer number and Result : 
  •      One Command Button - Caption is Check
  •       One Text Box
(C) Attaching Code to the Object :
(Splash Screen Code is not given)
Private Sub Command1_Click()
Dim num As Integer
num = Val(Text1.Text)
If num Mod 2 = 0 Then
Label2.Caption = "Result : The number is even"
Else
Label2.Caption = "Result : The number is odd"
End If
End Sub


      • ====================================================================
        Back to Home   &  VB
    ===========================================================

    No comments: