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
0 comments: