C-Control Instructions Questions and Answers

Practice Mode
Showing 10 of 24 questions
Q11
How many times will this loop execute: while(0){ printf("Hello"); }
  • A 0 times
  • B 1 time
  • C Infinite times
  • D 2 times
Answer: Option A
Explanation: While(0) means false condition, so loop never executes.
Q12
What is the purpose of switch statement in C?
  • A To declare variables
  • B To perform mathematical operations
  • C To handle multiple conditions efficiently
  • D To define arrays
Answer: Option C
Explanation: Switch provides multi-way branching based on different cases.
Q13
Which is mandatory in a switch statement?
  • A default case
  • B break statement
  • C case values
  • D All are mandatory
Answer: Option C
Explanation: Default case is optional, break is optional, but case values are mandatory for functionality.
Q14
What happens if break is omitted in a switch case?
  • A Compiler error
  • B Execution stops
  • C Falls through to next case
  • D Jumps to default case
Answer: Option C
Explanation: Without break, execution falls through to the next case.
Q15
Which operator has highest precedence in condition checks?
  • A Logical AND (&&)
  • B Logical OR (||)
  • C Logical NOT (!)
  • D All have same precedence
Answer: Option C
Explanation: Logical NOT has higher precedence than AND and OR operators.
Q16
What is the result of: if(5) printf("True"); else printf("False");
  • A True
  • B False
  • C Compilation error
  • D Runtime error
Answer: Option A
Explanation: Non-zero values are considered true in C conditions.
Q17
Which is not a jump statement in C?
  • A break
  • B continue
  • C goto
  • D return
Answer: Option D
Explanation: Return is used for functions, not specifically for jumping within control structures.
Q18
What is goto statement used for?
  • A To call functions
  • B To declare variables
  • C For unconditional jumping within function
  • D To terminate programs
Answer: Option C
Explanation: Goto provides unconditional jump to a labeled statement in the same function.
Q19
Which loop is best when number of iterations is known?
  • A while loop
  • B do-while loop
  • C for loop
  • D All are equally good
Answer: Option C
Explanation: For loop is ideal when iteration count is known beforehand.
Q20
What does while(1) represent?
  • A Loop that runs once
  • B Infinite loop
  • C Loop that never runs
  • D Conditional loop
Answer: Option B
Explanation: While(1) creates an infinite loop as condition is always true.
Questions and Answers for Competitive Exams Various Entrance Test