MCQ Bank
The repetitive use of an instruction or sequence of instructions is an important algorithmic concept. One method of implementing such repetition is the iterative structure known as the ______.
- A) If else
- B) Class
- C) Condition
- D) Loop
Which of the following terms refers to the process in which a small request is initially made and detailed solution is shared later?
- A) Foot-in-the-door technique
- B) High-balling
- C) Low-balling
- D) Door-in-the-face technique
In the following C/C++ programming statement, what does Z represent? Z = X + Y;
- A) A variable
- B) A keyword
- C) A function
- D) A constant
Which of the following symbol is used as assignment operator in Ada.
- A) ,
- B) ;
- C) :=
- D) =
How many times will the loop in the example below execute? int i=1; while(i<=5) { cout<<i; }
- A) 3 times
- B) 4 times
- C) 5 times
- D) Infinite times
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