Monday, September 21, 2015

PRINT STAR PATTERN IN VB.NET USING NESTED FOR LOOP






Above pattern print program is given below -

  Dim row, col, noofrow, noofcol, colspace, temp As Integer
        noofrow = 15 : noofcol = noofrow : temp = 1
        For row = 1 To noofrow
            For colspace = noofcol - row To 1 Step -1
                Console.Write(" ")
            Next
            For col = 1 To temp
                Console.Write("*")
            Next
            Console.Write(vbNewLine)
            temp += 2
        Next

0 comments:

Post a Comment