Code a program that ask a leper to enter the number of rows then it prints the number of rows in pyramids of stars as shown below
*
* * *
* * * *
* * * * *
* * * * * *
Imports System.IO
Module Module1
Sub Main()
Console.Write("Enter the number of rows: ")
Dim rows As Integer = Integer.Parse(Console.ReadLine())
For i As Integer = 1 To rows + 1
If i <> 2 Then
For j As Integer = i To rows + 1
Console.Write(" ")
Next
For k As Integer = 1 To i
Console.Write("* ")
Next
Console.WriteLine()
Console.WriteLine()
End If
Next
Console.ReadLine()
End Sub
End Module
Comments
Leave a comment