MCQ Bank
The language understood by a computer without translation is known as:
- A) Machine Language
- B) Assembly language
- C) Command Language
- D) High Level Language
Someone can conclude that specifications of a software are met or not by:
- A) Validation
- B) Modularity
- C) Verification
- D) Requirement gathering
What is the role of the loop counter "i" in the given pseudo-code? f = 1 i=1 While (i<=n): f=f*i i=i+1
- A) To control the number of iterations in the loop
- B) To reset the loop condition
- C) To compare with the value of "n"
- D) To determine the initial value of "f"
What will be the value of "n" after the first iteration of the while loop in the given pseudo-code? f = 1 i=1; While (i<=n): f=f*i; i=i+1;
- A) n
- B) Cannot be determined
- C) 2
- D) 1
What is the purpose of the while loop in the pseudocode routine of the sequential search algorithm? Select the first entry in List to be TestEntry. while (TargetValue > TestEntry and there remain entries to be considered): Select the next entry in List as TestEntry. if (TargetValue == TestEntry): Declare search a success. else: Declare search a failure.
- A) To terminate the search
- B) To sort the list
- C) To iterate through the list entries
- D) To compare TestEntry with TargetValue
In the declarative paradigm, what does a programmer focus on when presented with a problem?
- A) Developing a sequence of commands
- B) Developing a precise statement of the problem
- C) Describing detailed algorithms
- D) Finding a general-purpose algorithm
In searching, If the target value is not in the original list, our approach to searching the list will proceed by dividing the list into
- A) Equal parts
- B) Not divide
- C) Smaller parts
- D) Greater parts
In what case both the print statements will be executed in the following code? if (marks>60) Print(You have passed the examination) Else Print(You have failed the examination)
- A) Marks are less than 60
- B) Marks are greater than 60
- C) Marks are less than or equal to 60
- D) Both cannot be executed at a time
In C++, symbolic representation for 'Equal to' relational operator is ________.
- A) ==
- B) =
- C) !=
- D) &
What does the while statement in a loop structure signify?
- A) The end of the loop.
- B) The body of the loop.
- C) The condition for repeating the loop.
- D) The initialization of loop variables.
In the given example, what does the loop do? while (pH level > 4): add a drop of sulfuric acid
- A) Adds a drop of sulfuric acid only once.
- B) Adds a drop of sulfuric acid if the pH level is less than or equal to 4.
- C) Adds a drop of sulfuric acid regardless of the pH level.
- D) Adds a drop of sulfuric acid if the pH level is greater than 4.
What will be the output of the following pseudocode? marks = 60 if (marks>=50) Print(You have passed the examination) Else Print(You have failed the examination)
- A) You have failed the examination
- B) Both messages will be displayed
- C) No message will be displayed
- D) You have passed the examination
Loop, is executed in a repetitive fashion under the direction of some
- A) Under some background knowledge
- B) Sequence process
- C) Control process
- D) Halting process
What advantage does a loop structure provide over explicitly writing the body multiple times?
- A) It simplifies the structure of the algorithm.
- B) It increases the error-proneness of the algorithm.
- C) It reduces the flexibility of the algorithm.
- D) It allows for greater flexibility without knowing in advance how many iterations are needed.
What will be the output of the loop for the given example? int i=3; while(i<=5) { cout<<i; i=i+1; }
- A) 12345
- B) 333
- C) 345
- D) 54321
What were developed to convert mnemonic expressions into machine language instructions?
- A) Interpreters
- B) Programs
- C) Compilers
- D) Assemblers
In __________ paradigm, task of programmer is to develop a precise problem statement rather than designing an algorithm for solving the problem.
- A) Object-Oriented
- B) Imperative
- C) Declarative
- D) Functional
Control structure which iterates a set of instructions based on the provided condition, is called a ______________.
- A) Conditional statement
- B) Function
- C) Loop
- D) Class
Post test loop structure refer to?
- A) Test for termination is performed as well as the body is executed
- B) Test for termination is performed after the body is executed
- C) Test for termination is performed with the body is executed
- D) Test for termination is performed before the body is executed
Sequential search involves a circular form of repetition; the binary search executes each stage of the repetition as a subtask of the previous stage known as
- A) Transition
- B) Recursion
- C) Searching
- D) Decomposition