Click here to Skip to main content
15,893,381 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
How to draw pattern using vb.net..my output should be displayed like below.

OUTPUT:
*
**
***
**
*
Kindly do the needful
Posted
Updated 17-Nov-22 1:23am

1 solution

Check this one.
VB
Public Shared Sub pattern()
    Dim n As Integer = 3
    For i As Integer = 0 To n - 1
        For k As Integer = 0 To i - 1
            Console.Write("*")
        Next
        Console.WriteLine()
    Next
    For i As Integer = n To 1 Step -1
        For k As Integer = i To 1 Step -1
            Console.Write("*")
        Next
        Console.WriteLine()
    Next

End Sub
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900