Friday, September 18, 2015

PRINT STAR PATTERN IN VB.NET USING NESTED FOR LOOP




No of operand= row, col, noofrow
Row printing range= 1 to 5
Column printing range = 1 to row

Given program is -

Option Strict On
Module Module1
    Sub Main()
        Dim row, col, noofrow As Integer
        noofrow = 5
        For row = 1 To noofrow Step 1
            For col = 1 To row Step 1
                Console.Write("*")
            Next
            Console.Write(vbNewLine)
        Next
End Module
 

0 comments:

Post a Comment