Which of the following is equivalent to this code segment?



int total = 0;


for (int i = 0; i <= 20; i += 2)
total += i;

a. int total = 0;
for (int i = 20; i < 0; i += 1)
total += i;
b. int total = 0;
for (int i = 0; i <= 20; total += i, i += 2);
c. int total = 0;
for (int i = 0, i <= 20, total += i; i += 2);
d. int total = 0;
for (int i = 2; i < 20; total += i, i += 2);


b. int total = 0;
for (int i = 0; i <= 20; total += i, i += 2);

Computer Science & Information Technology

You might also like to view...

You remove the AD DS role from a domain controller using the Remove Roles Wizard

Indicate whether the statement is true or false

Computer Science & Information Technology

At minimum, test data should try to achieve ____.

A. boundary conditions B. complete code coverage C. extreme conditions D. short-circuit evaluation

Computer Science & Information Technology

When you save a document, you are creating a ____.?

A. ?file B. ?key C. ?library entry D. ?link

Computer Science & Information Technology

This data encryption standard is the weakest of the wireless encryption standards, with many problems, including encryption that is easy to break; it only encrypts the Data Link and Physical layers, the key is static and shared, and there is no mechanism for performing user authentication.

A. Wired Equivalent Privacy (WEP) B. Mac address filtering C. Wi-Fi Protected Access (WPA) D. Wi-Fi Protected Access 2 (WPA2)

Computer Science & Information Technology