0% found this document useful (0 votes)
34 views1 page

Sub Dim As Integer: "Enter 1 Number" "1 Cheak Positive Negative 2 Odd/even 3 Exit"

This code prompts the user to enter a number, then displays a menu asking the user to select checking if the number is positive or negative, odd or even, or exit. Based on the user's selection, the code performs the corresponding check on the number and displays the result.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views1 page

Sub Dim As Integer: "Enter 1 Number" "1 Cheak Positive Negative 2 Odd/even 3 Exit"

This code prompts the user to enter a number, then displays a menu asking the user to select checking if the number is positive or negative, odd or even, or exit. Based on the user's selection, the code performs the corresponding check on the number and displays the result.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Module Module1

Sub Main()
Dim num, c As Integer
Console.WriteLine("enter 1 number")
num = Console.ReadLine()
Console.WriteLine("1 cheak positive negative 2 odd/even 3 exit")
c = Console.ReadLine()
Select Case c
Case 1
If (num >= 0) Then
Console.WriteLine("positive number")
Else
Console.WriteLine("negative number")
End If
Case 2
If (num Mod 2 = 0) Then
Console.WriteLine("even number")
Else
Console.WriteLine("odd number")
End If
Case 3
Console.WriteLine("exit")
Case Else
Console.WriteLine("wrong input")
End Select
Console.ReadLine()
End Sub
End Module

You might also like