Solved

Consider the Following Two C# Code Segments

Question 3

Multiple Choice

Consider the following two C# code segments:
Segment 1 Segment 2
Int i = 0;
For (int i=0;i < = 20;++i)
While (i < 20) {
{ Console.WriteLine (i) ;
++i; }
Console.WriteLine (i) ;
}
Which of the following statements is true


A) The output from these segments is not the same.
B) The scope of the control variable i is different for the two segments.
C) Both (a) and (b) are true.
D) Neither (a) nor (b) is true.

Correct Answer:

verifed

Verified

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents