Tuesday 13 November 2012

Even | Odd number | 1 to 10 ..n | vb.net source code



Even number is a number which is divisible by 2 .
Odd number is number which is not divisible by 2.
lets take examples.
4 /2=2.
when we divide number 4 to number 2 it will not gives remainder so four is Even number .
second examples is 5 divided by 2 i.e 5/2 remeainde will be 1.so 5 is odd number.
in this program it shown to create function in vb.net and call that function in any event like
button click event.
   
Public Sub even_number()
        Dim takeval As Integer = txtVal.Text

        Dim first As Integer = 0
        While first < takeval
            If (takeval Mod 2) = 0 Then


                Response.Write(takeval)

            Else
                Response.Write("<br/> ")

            End If
            takeval -= 1
        End While

    End Sub
Share This
Previous Post
Next Post

FYJC XI standard online admisson Process and declaraton of Merit list . Cut off List For prevous year also . 10 Th Results onlne declaraton Maharashtra Region .

0 comments: