MCQs Test Online

Programming basics MCQs with answers

27 MCQs with answers on this topic. 12 are on this page: tap an answer to check it.

12 questions with answers

Question 1 of 12

A step-by-step finite procedure for solving a problem is called what?

Show answer

Answer: B. Algorithm

An algorithm is a well-defined sequence of steps that produces a result.

Question 2 of 12

In a flowchart, which symbol is conventionally used to show a decision?

Show answer

Answer: C. Diamond

A diamond has a question with two or more exit paths.

Question 3 of 12

A program runs without crashing but calculates a wrong average because the wrong formula was written. What kind of error is this?

Show answer

Answer: D. Logic error

The code is valid, but its logic does not match what was intended.

Question 4 of 12

In a flowchart, which shape is normally used for a processing step such as a calculation?

Show answer

Answer: D. Rectangle

The rectangle represents an action or process.

Question 5 of 12

In a flowchart, which symbol conventionally represents input or output?

Show answer

Answer: A. Parallelogram

The parallelogram marks data entering or leaving the process.

Question 6 of 12

Which search method repeatedly halves a sorted list to find an item?

Show answer

Answer: A. Binary search

Binary search works only on ordered data and discards half of the remaining items at each step.

Question 7 of 12

The process of finding and removing errors from a program is called what?

Show answer

Answer: B. Debugging

Debugging locates the cause of faulty behaviour and corrects it.

Question 8 of 12

An informal, language-independent description of a program's logic is called what?

Show answer

Answer: C. Pseudocode

Pseudocode helps plan logic without following the strict syntax of a programming language.

Question 9 of 12

In object-oriented programming, which concept allows a new class to acquire the properties and methods of an existing class?

Show answer

Answer: D. Inheritance

Inheritance supports reuse by deriving one class from another.

Question 10 of 12

In programming, a named storage location whose value can change is called what?

Show answer

Answer: D. Variable

A variable gives a name to a value that may be updated while the program runs.

Question 11 of 12

Which translator typically translates and executes a program statement by statement instead of producing a complete machine-code program first?

Show answer

Answer: D. Interpreter

In the classic distinction, an interpreter runs the source as it processes it, while a compiler translates it all beforehand.

Question 12 of 12

Bundling data with the methods that act on it and restricting direct outside access is called what?

Show answer

Answer: D. Encapsulation

Encapsulation hides internal details behind a defined interface.

These are practice questions, not official or past papers. They may contain mistakes.

More Computer topics

Tests that include Computer