Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The output from these segments is the same. Declaring the counter inside a for l

ID: 3672427 • Letter: T

Question

       The output from these segments is the same.
       Declaring the counter inside a for loop is illegal.
       The output from these segments is not the same.
       None of the above

18. (TCO 5) Consider the following Visual Basic code segments:

Segment 1:

Dim i As Integer = 0
While i <= 1300
     Console.WriteLine ( i.ToString("N0") )
     i += 1
End While

Segment 2:

For i As Integer = 0 To 1300 Step 1
     Console.WriteLine ( i.ToString("N0") )
Next

Which of the following statements is true? (Points : 5)

Explanation / Answer

After My Analysis declare a variable inside for loop is allowed..

what i am expecting after compare the both the statements..Both will produce the same output

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote