Programming Languages & Generations Questions with Answers

25 practice questions on Programming Languages & Generations (Computer Fundamentals) with answers and step-by-step solutions. Try 10 samples below, then practise all 25 free in the AptiNest app.

Sample questions

Question 1Easy

C, C++ and Java are examples of

  1. Machine languages
  2. High-level languages
  3. Assembly language programs
  4. Query languages

Answer: B. High-level languages

Explanation

High-level languages use English-like syntax and are third generation (3GL).

Step-by-step solution

  1. High-level languages use English-like syntax and are third generation (3GL).
  2. So the answer is: High-level languages.

Why the other options are wrong

  • A. Machine language is binary.
  • C. Assembly uses mnemonics.
  • D. Query languages are used for data.

Question 2Easy

A program that translates the whole source code into machine code before execution is a

  1. Compiler
  2. Interpreter
  3. Assembler
  4. Editor

Answer: A. Compiler

Explanation

A compiler translates the whole program first, and then the machine code runs.

Step-by-step solution

  1. A compiler translates the whole program first, and then the machine code runs.
  2. So the answer is: Compiler.

Why the other options are wrong

  • B. An interpreter runs line by line.
  • C. An assembler converts assembly.
  • D. An editor writes the code.

Question 3Easy

Which generation of programming language is machine language?

  1. Second generation
  2. Third generation
  3. Fourth generation
  4. First generation

Answer: D. First generation

Explanation

Machine language uses binary code and is the first-generation language (1GL).

Step-by-step solution

  1. Machine language uses binary code and is the first-generation language (1GL).
  2. So the answer is: First generation.

Why the other options are wrong

  • A. Assembly language is second.
  • B. High-level languages are third.
  • C. SQL-like languages are fourth.

Question 4Easy

Assembly language is which generation of language?

  1. Second generation
  2. First generation (1GL)
  3. Third generation (3GL)
  4. Fifth generation (5GL)

Answer: A. Second generation

Explanation

Assembly language uses mnemonics such as ADD and MOV. It is 2GL.

Step-by-step solution

  1. Assembly language uses mnemonics such as ADD and MOV.
  2. It is 2GL.
  3. So the answer is: Second generation.

Why the other options are wrong

  • B. Machine language is first.
  • C. High-level languages are third.
  • D. Fifth is AI or logic-based.

Question 5Medium

An error caused by violating the grammar rules of a language is a

  1. Logical error
  2. Syntax error
  3. Runtime error
  4. Semantic error in output only

Answer: B. Syntax error

Explanation

A syntax error stops compilation. Fix the code according to language rules.

Step-by-step solution

  1. A syntax error stops compilation.
  2. Fix the code according to language rules.
  3. So the answer is: Syntax error.

Why the other options are wrong

  • A. A logical error gives wrong output.
  • C. A runtime error happens during execution.
  • D. Semantic errors relate to meaning.

Question 6Medium

Dividing by zero at run time causes

  1. A syntax error
  2. A compile-time error
  3. No error ever
  4. A runtime error

Answer: D. A runtime error

Explanation

Runtime errors occur during execution, for example division by zero.

Step-by-step solution

  1. Runtime errors occur during execution, for example division by zero.
  2. So the answer is: A runtime error.

Why the other options are wrong

  • A. Division by zero is valid syntax.
  • B. The compiler does not check values at run time.
  • C. It does produce an error.

Question 7Medium

An assembler converts

  1. High-level code into assembly
  2. Machine code into C
  3. Assembly language into machine code
  4. Java into Python

Answer: C. Assembly language into machine code

Explanation

An assembler translates mnemonics to machine instructions.

Step-by-step solution

  1. An assembler translates mnemonics to machine instructions.
  2. So the answer is: Assembly language into machine code.

Why the other options are wrong

  • A. That is the compiler.
  • B. This is a disassembler direction.
  • D. Not an assembler task.

Question 8Medium

Which program combines object files and libraries into an executable?

  1. Loader
  2. Debugger
  3. Editor
  4. Linker

Answer: D. Linker

Explanation

The linker resolves references among object modules and libraries to form an executable.

Step-by-step solution

  1. The linker resolves references among object modules and libraries to form an executable.
  2. So the answer is: Linker.

Why the other options are wrong

  • A. A loader puts the program into memory.
  • B. A debugger finds errors.
  • C. An editor writes code.

Question 9Hard

Which language is mainly used for artificial intelligence and was created by John McCarthy in 1958?

  1. LISP
  2. COBOL
  3. FORTRAN
  4. Ada

Answer: A. LISP

Explanation

LISP was designed for symbolic computation and AI research.

Step-by-step solution

  1. LISP was designed for symbolic computation and AI research.
  2. So the answer is: LISP.

Why the other options are wrong

  • B. COBOL is for business.
  • C. FORTRAN is for science.
  • D. Ada is for safety-critical systems.

Tip: The clues 'artificial intelligence' and John McCarthy point to LISP, designed for symbolic computation; check the creator clue.

Question 10Hard

The word "bug" in debugging was popularised by

  1. Ada Lovelace
  2. Dennis Ritchie
  3. Grace Hopper
  4. Alan Turing

Answer: C. Grace Hopper

Explanation

Grace Hopper's team found a moth in a relay of Harvard Mark II in 1947, which popularised the term debugging.

Step-by-step solution

  1. Grace Hopper's team found a moth in a relay of Harvard Mark II in 1947, which popularised the term debugging.
  2. So the answer is: Grace Hopper.

Why the other options are wrong

  • A. Lovelace wrote the first algorithm.
  • B. Ritchie created C.
  • D. Turing worked on theory.

Tip: The 'bug' anecdote (a moth found in a relay) is linked to Grace Hopper; match the famous story to the right person.

Practise all 25 questions free

The full question bank with timed practice, progress tracking and Vidya, your AI tutor. Free, no ads.

Open this topic in the app →

Related topics

See all Computer Fundamentals topics · All topics