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

int i = 1, j = 1; for (i = 1; i < 4; i++) { for (j = 1; j < 4; j++) { Console.Wr

ID: 3773282 • Letter: I

Question

            int i = 1, j = 1;
            for (i = 1; i < 4; i++)
            {
                for (j = 1; j < 4; j++)
                {
                    Console.Write("{0}{1} ", i, j);
                }
            }

       three
       four
       nine
       16

Question 10.10. (TCO 5) In this code, the outer FOR loop executes _____ times.

            int i = 1, j = 1;
            for (i = 1; i < 4; i++)
            {
                for (j = 1; j < 4; j++)
                {
                    Console.Write("{0}{1} ", i, j);
                }
            }

(Points : 5)

Explanation / Answer

for(i = 1; i < 4; i++);

Considering this, the loop starts with i value of 1, and will proceed as long as i value is less than 4, which is gradually increased by 1.

Therefore the loop runs for values, 1, 2, and 3. When the i value becomes 4, the condition (i < 4) fails, and therefore, the outer loop exits.

Hence the answer for your question is: three.