How to count backwards (Print the numbers N, N - 1, ..., 0 (included)) in VB.NET

1 Answer

0 votes
Imports System

Class Program
    Public Shared Sub Main()
        Dim n As Integer = 5

		For i As Integer = n To 0 step -1
            Console.Write(i & " ")
        Next
    End Sub
End Class



' run:
'
' 5 4 3 2 1 0 
'

 



answered Jul 20, 2025 by avibootz
...