C Arrays Quiz – 20 Questions with Answers
20 questions · 15 min · Medium
Test your knowledge of control instructions in C, including conditional statements, loops, switch statements, break, continue, and jump statements.
No sign-up needed · Last updated:
Score: 0 00:00
Create a free account to keep your scores and track your progress. It is optional.
20 questions · 15 min · Medium
15 questions · 12 min · Medium
15 questions · 12 min · Medium
15 questions · 12 min · Medium
15 questions · 12 min · Medium
15 questions · 12 min · Medium
A. if
The if statement executes its associated statement or block when the specified condition evaluates to true.
A. else
The else statement provides an alternative block of code when the associated if condition is false.
A. else if
An else if statement allows multiple conditions to be checked in sequence.
A. switch
The switch statement selects among multiple case labels based on the value of an integral or enumeration expression.
A. default
The default label in a switch statement is executed when none of the case labels matches the switch expression.
A. for
The for loop combines initialization, a controlling condition, and an iteration expression in its syntax.
A. while
A while loop evaluates its controlling expression before each iteration, so its body may execute zero times.
A. do-while
A do-while loop executes its body before testing the condition, so the body runs at least once.
A. break
The break statement terminates execution of the nearest enclosing loop or switch statement.
A. continue
The continue statement skips the remainder of the current loop body and continues with the next iteration.
A. To transfer control to a labeled statement
The goto statement transfers execution directly to a statement identified by a label within the same function.
A. Yes
Since x is 5 and 5 > 3 is true, the statement inside the if branch prints Yes.
A. Execution exits the switch statement
A break statement exits the nearest enclosing switch statement. Without break, execution can continue into subsequent cases.
A. 0 1 2
The loop starts at 0 and continues while i is less than 3, producing 0, 1, and 2.
A. Selection
An if-else statement is a selection control structure because it chooses which block of code to execute based on a condition.