What is assigned to the answer variable after the following code is executed?
?
int answer = 0;
int yNum = 0;
do 
{
   for (int xNum = 1; xNum < 3; xNum +=1)
      answer = answer * xNum;
   yNum += 1;
} while (yNum < 3);

A. 0
B. 6
C. 18
D. 36


Answer: A

Computer Science & Information Technology

You might also like to view...

When a variable is declared in a(n) ____ statement at the beginning of a procedure, it has procedure scope and can be used by the entire procedure.

A. Dim B. New C. As D. Create

Computer Science & Information Technology

Bottlenecks tend to develop ____.

A. when the system is underutilized B. when resources reach their capacity C. when the system is mismanaged D. in a deadlocked system

Computer Science & Information Technology

A "while loop" is a pretest loop; that is, the condition is evaluated before the body of the loop is executed.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

The ____________________ feature forces text to stay within the confines of the Code Inspector window, allowing you to read without scrolling sideways.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology