Answer to Question #267925 in Visual Basic for Navy1

Question #267925

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

*

* * *

* * * *

* * * * *

* * * * * *






1
Expert's answer
2021-11-18T06:46:40-0500
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

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS