Pages

Number Triangle 2


Module numbers_2
    Sub Main()
        Dim i, j, n As Integer
        Console.Write("Enter the number of lines:")
        n = CInt(Console.ReadLine())
        For i = 1 To n
            For j = 1 To i
                Console.Write(i & " ")
            Next
            Console.WriteLine()
        Next
        Console.ReadLine()
    End Sub
End Module
Output
1
2 2
3 3 3
4 4 4 4
5 5 5 5 5

3 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. how you can i get this kind of output


    1
    2 4
    3 6 9
    4 8 12 16
    5 10 15 20 25

    thnxs for your response

    ReplyDelete
  3. how you can i get this kind of output


    1
    2 4
    3 6 9
    4 8 12 16
    5 10 15 20 25

    thnxs for your response

    ReplyDelete