MCQ Bank
What are descriptive names like "Price," "ShippingCharge," and "TotalCost" often called in programming?
- A) Numeric forms
- B) Program variables or identifiers
- C) Mnemonics
- D) Machine codes
The imperative paradigm, also known as the Particular machine
- A) Procedural paradigms
- B) Non-Procedural paradigms
- C) Non traditional paradigms
- D) Traditional paradigms
Why does the composition of loop control deserve attention?
- A) It is the more error-prone part of the structure.
- B) It has no impact on the algorithm's performance.
- C) It is only relevant for simple algorithms.
- D) It is typically error-free and does not require attention.
Distinction between Program believed to be correct and the program that is correct is
- A) Software Modularity
- B) Software Verification
- C) Software Validation
- D) Software requirement gathering
What is the primary goal of the Sequential search algorithm?
- A) Randomizing list elements
- B) Searching for a specific target value
- C) Sorting a list
- D) Detecting duplicate entries
How is the termination condition reached in loop control?
- A) By skipping the test activity
- B) By executing the test activity
- C) By repeating the initialization step
- D) By applying the modification step repeatedly
What is the purpose of the provided pseudocode? def FindMax(): max = first number in the list Current = second number in the list While (elements in the list exist) If (max<current) max=current Current = next value in the list
- A) Counting the number of elements in a list
- B) Finding the maximum number in a list
- C) Finding the average of a list
- D) Sorting a list in ascending order
Write an if-statement to check if a variable temperature is above 30 degrees Celsius and print "High temperature" if true.
- A) if (temperature < 30) { cout << "High temperature"; }
- B) if (temperature >= 30) { cout << "High temperature"; }
- C) if (temperature == 30) { cout << "High temperature"; }
- D) if (temperature > 30) { cout << "High temperature"; }
The binary search algorithm uses…….
- A) Linear search
- B) Bubble sort technique
- C) Divide and conquer method
- D) Quick sort technique
In insertion sort, how will the array of elements look like after second comparison?
{34, 8, 64, 51, 32, 21}
- A) 8, 34, 64, 51, 32, 21
- B) 8, 21, 32, 34, 51, 64
- C) 8, 34, 51, 64, 32, 21
- D) 8, 32, 34, 51, 64, 21
What is the primary focus of a programmer in a declarative programming system?
- A) Describing algorithms
- B) Developing problem-solving algorithms
- C) Writing procedural code
- D) Developing a precise statement of the problem
How many iterations are required to find 90 in the following array?
{5, 6, 77, 90, 99}
- A) 3
- B) 2
- C) 1
- D) 4
In the context of a loop structure, which part is called the body of the loop?
- A) The termination condition
- B) The collection of instructions executed repetitively
- C) The control process
- D) The initial condition
How does the loop structure contribute to the flexibility of an algorithm?
- A) By reducing the flexibility of the algorithm.
- B) By allowing for a variable number of iterations.
- C) By explicitly writing the body multiple times.
- D) By increasing the error-proneness.
This finding maximum number function will keep on going until we reach at the last value
[12,18,299,38,999,89,101,500,801,45]
- A) 38 each time
- B) 45 each time
- C) 12 each time
- D) 801 each time
How many times the loop condition will be evaluated for n = 5? f = 1 i=1; While (i<=n) f=f*i; i=i+1;
- A) 1
- B) 10
- C) 4
- D) 6
What does the variable "f" represent in the pseudo-code? f = 1 i=1; While (i<=n): f=f*i; i=i+1;
- A) The factorial of the number
- B) The condition for loop termination
- C) The initial value of the loop
- D) The loop counter
What distinguishes the declarative paradigm from the imperative paradigm in programming?
- A) The use of pre-established algorithms
- B) Describing algorithms for problem-solving
- C) The emphasis on procedural programming
- D) Developing precise statements of problems
When applied to a list with n entries, the binary search algorithm will interrogate an average of ------ entries
- A) Nlogn
- B) Log2n
- C) N
- D) Logn
_________loop structure referred to as a post-test loop
- A) For each
- B) For
- C) Repeat
- D) While