Tuesday, September 22, 2015

PRINT STAR PATTERN IN VB.NET USING NESTED FOR LOOP


Above pattern print program is given below -

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

0 comments:

Post a Comment