Vb.Net Console Application Program To Check Number Is Odd Or Even

Defination: Write a Vb.net Console Based Application Program to Get User define Number and Check This Number Is Odd Or Even.

Source Code: 

Module Module1

    Dim no As Integer

    Sub Main()

        System.Console.Write("Enter Any Number For Check Odd Or Even:-")
        no = System.Console.ReadLine()

        If no Mod 2 = 0 Then
            System.Console.WriteLine("This Number Is Even")
        Else
            System.Console.WriteLine("This Number Is Odd")
        End If

        System.Console.Read()

    End Sub

End Module


Output:

 Enter Any Number For Check Odd Or Even:- 10
 This Number Is Even 

Explanation: 

'Dim no As Integer' is a Declare a Integer Variable That is Store a Numeric Value From The User.
'System.Console.Write' is a a System inbuilt Function that can Display Message on The Screen and Output Display on The Screen.
'System.Console.ReadLine()' is a get The input value from the user and stored the Value from the Variable and check the Conditions.
 'System.Console.Read()' is a System inbuilt Function That Can Hold The Output on The Screen for the User Input.
   
Vb.Net Console Application Program To Check Number Is Odd Or Even Vb.Net Console Application Program To Check Number Is Odd Or Even Reviewed by Unknown on 8:39:00 PM Rating: 5

4 comments:

  1. Here all described it's might be all of you know
    The admins should have explained logic

    ReplyDelete
  2. Nice article . you can use & operator for checking even or odd any number reference check even or odd without modulo

    ReplyDelete
  3. It has been a long time since I've read anything so informative and compelling. I'm waiting for the next article from the writer. Thank you.

    Dot Net Training in Chennai | Dot Net Training in anna nagar | Dot Net Training in omr | Dot Net Training in porur | Dot Net Training in tambaram | Dot Net Training in velachery



    ReplyDelete

Powered by Blogger.