Write a visual basic code that will display the odd number in a user defined range
Module Module1
Sub Main()
Dim min, max As Integer
Console.Write("Enter the min number: ")
min = Integer.Parse(Console.ReadLine())
Console.Write("Enter the max number: ")
max = Integer.Parse(Console.ReadLine())
Console.WriteLine("All odd numbers in a user defined range")
For i = min To max
If i Mod 2 <> 0 Then
Console.WriteLine(i.ToString())
End If
Next
Console.ReadLine()
End Sub
End Module
Comments
Leave a comment