Solved

The for Loop Header Can Contain Multiple Variables of the Same

Question 52

Multiple Choice

The for loop header can contain multiple variables of the same type and multiple update expressions, separated by commas:

for (int i = 0; j = 3; i <= 5; i++, j--)
Which loop below correctly implements the same loop using a single counter in the loop control?


A) int i=0;
for (int j=3 ; j<=5 ; j++ )
{
i++;
}
B) Int i=3;
for (int j=0 ; j<=5 ; j++ )
{
i++;
}
C) int j=3;
for (int i=0 ; i<=5 ; j--)
{
i++;
}
D) Int j=3;
for (int i=0 ; i<=5 ; i++)
{
. . .
j--;
}

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

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