Ejercicio
Números impares descendentes
Objetivo
Cree un programa en Visual Basic para mostrar en pantalla los números impares del 15 al 7 (hacia abajo), usando "while"
Código
' Import the System namespace to use Console class
Imports System
Public Class Program
' Main subroutine, entry point of the program
Public Shared Sub Main()
' Initialize the starting number as 15
Dim number As Integer = 15
' Start a while loop to display odd numbers from 15 to 7
While number >= 7
' Display the current odd number
Console.WriteLine(number)
' Decrease the number by 2 to get the next odd number in descending order
number -= 2
End While
End Sub
End Class