In each case click the single most appropriate response. Only the correct response will register in the radio button.

Used to group statements into a compound statement ...

{ }
( )
[ ]
<>
begin ... end

A linear nested if construct has ...

all parts of the statement on the same line
functions nested in the else blocks
functions nested in the if blocks
if statements nested in the else blocks
if statements nested in the if blocks

What does a break statement do?

forces a new page on the printout
causes the current block of code to be exited
causes the current function to be exited
causes the whole program to be exited
take a break; have a Kit-kat

The goto statement ...

should not be used in structured programming
is used to call a function
is used to call a separate program
is used to get user input
is used to terminate execution of a program

w = (y > z) ? 27 : 42;

is not a valid C statement
is line number 42 in a program
assigns 27 to z if w equals 42
assigns 27 to y if y greater than z
assigns 27 to w if y greater than z

p = (q != 8) ? 27 : 42;

if q equals 8, p is assigned 27
if q equals 8, p is assigned 42
if negation of q equals 8, p is assigned 27
if logical not of q equals 8, p is assigned 27
if p equals 42, q is assigned 27 minus 8

for (n = 0; n <= 10; n++) { ... }

loop goes round 9 times
loop goes round 10 times
loop goes round 11 times
loop goes round 12 times
loop never exits

while (n >= 10) { ... }

executes loop body if n equals 10
executes loop body if n equals 11
executes loop body if n equals 12
executes loop body if n equals 13
all of the above

do { ... } while (n > 10)

jumps to start of loop if n equals 8
jumps to start of loop if n equals 9
jumps to start of loop if n equals 10
jumps to start of loop if n equals 11
none of the above

Tests at the bottom of the loop body ...

if ... else
switch
for
while
do ... while

Wrong answers so far:

top