The output from these segments is the same. Declaring the counter inside a for l
ID: 3672425 • 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
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
As per my Analysis..Declaring a variable inside for loop is allowed..
So the output may be the same for the both Segment 1 and 2
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.