Imports System
Public Class Program
Public Shared Sub BinaryNumbersRightTriangle(ByVal rows As Integer)
Dim bin As Integer = 1
For i As Integer = 0 To rows - 1
For j As Integer = 0 To i
Console.Write(bin)
Console.Write(" ")
bin = If((bin = 1), 0, 1)
Next
bin = i Mod 2
Console.WriteLine()
Next
End Sub
Public Shared Sub Main(ByVal args As String())
BinaryNumbersRightTriangle(7)
End Sub
End Class
' run:
'
' 1
' 0 1
' 1 0 1
' 0 1 0 1
' 1 0 1 0 1
' 0 1 0 1 0 1
' 1 0 1 0 1 0 1
'