McqkartGet appPractise

Statements: Algorithm solves a problem in a finite number

Which of the following statements are correct in the context of programming languages? Choose the correct answer from the options given below:

1.Algorithm solves a problem in a finite number of steps
2.Assembly language is a low level programming language
3.A code written in machine language is highly portable
4.Algorithms are implemented using programming languages
A1, 2 & 3 only
B1, 2 & 4 only ✓ Correct
C2, 3 & 4 only
D1, 3 & 4 only
Correct answer: (B) 1, 2 & 4 only
Explanation

Statements 1, 2 and 4 are true, while statement 3 is false because machine language code is tied to one type of processor and is the least portable of all.

An algorithm is a finite sequence of well-defined steps for solving a problem; its standard properties are finiteness, definiteness, input, output and effectiveness, so statement 1 holds.

The word algorithm comes from the name of the ninth-century mathematician al-Khwarizmi.

Assembly language is a low-level, second-generation language that uses mnemonics such as ADD, MOV and SUB in place of binary codes and needs an assembler to translate it, so statement 2 holds.

Machine language is the first-generation language written in 0s and 1s that the CPU executes directly; since each processor family has its own instruction set, a machine language program written for one does not run on another, which is why statement 3 fails.

Portability is a feature of high-level languages such as C, Java and Python, whose source code can be compiled or interpreted on different machines; Java achieves it through bytecode run on the Java Virtual Machine (JVM).

An algorithm is first expressed as a flowchart or pseudocode and is then coded in a programming language to become a program, so statement 4 holds.

Translators are of three kinds: an assembler for assembly language, a compiler that translates the whole high-level program at once, and an interpreter that translates and executes it line by line.

Early high-level languages include FORTRAN (1957) for scientific work, COBOL (1959) for business data processing and C (1972), developed by Dennis Ritchie at Bell Labs.

Fourth-generation languages such as SQL are query oriented, and fifth-generation languages such as Prolog are used in artificial intelligence.

Want more like this? Create a free account to practise a full test, track your progress, and get spaced-repetition review.

Practise on Mcqkart →🎓 Book an expert →