logo CodeStepByStep logo

StarsPrint

Language/Type: VB expressions for loops

What output is produced by each of the following code samples?

' A)
For i As Integer = 0 To 4
    For j As Integer = 0 To 9
        Console.Write("*")
    Next
    Console.WriteLine()   ' to end the line
Next
' B)
For i As Integer = 1 To 5
    For j As Integer = 1 To i
        Console.Write("*")
    Next
    Console.WriteLine()
Next
' C)
For i As Integer = 1 To 5
    For j As Integer = 1 To i
        Console.Write(i)
    Next
    Console.WriteLine()
Next
A)
B)
C)

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.