MCQ in UNIT1
MCQ in UNIT1
23. In an algorithm that uses both iteration and recursion, which is likely to run first?
o a) Iteration
o b) Recursion
o c) Both run simultaneously
o d) It depends on the algorithm
24. When solving problems with recursion, which component ensures the algorithm
doesn’t run indefinitely?
o a) Loop condition
o b) Base case
o c) Recursion depth
o d) Function return value
25. Which of the following is NOT an advantage of pseudocode?
o a) Easy to understand by non-programmers
o b) Language independent
o c) Can be executed by a compiler
o d) Focuses on the algorithm's logic
26. In the context of algorithms, what does modularity refer to?
o a) Breaking down a problem into independent modules
o b) Using recursion instead of iteration
o c) Optimizing memory usage
o d) Writing algorithms without using loops
27. Which of the following statements about functions is TRUE?
o a) Functions cannot be recursive
o b) Functions allow for code reusability
o c) Functions can only be used once in a program
o d) Functions increase code complexity
28. In algorithm design, which strategy can help break down a problem into smaller,
more manageable parts?
o a) Modularity
o b) Recursion
o c) Flowcharting
o d) Compilation
29. Which of the following will cause a recursive function to run indefinitely?
o a) No base case
o b) A break statement inside the function
o c) Using while loops
o d) All of the above
30. Which algorithm design strategy often leads to a divide-and-conquer solution?
o a) Iteration
o b) Recursion
o c) Decision-making
o d) Looping
31. Which of the following is NOT a valid characteristic of a good flowchart?
a) Oval
b) Diamond
c) Rectangle with double lines
d) Parallelogram
34. What is the key advantage of using flowcharts?
a) Decision
b) Input or output
c) Process
d) Loop