---
title: "Generations of programming languages"
subject: "Computer Programming"
chapter: 1
key: "semester_1/computer_programming:generations-programming-languages"
source: https://www.bctengineer.com/q/semester_1/computer_programming/generations-programming-languages
site: BCT Engineering
---

# Generations of programming languages

Computer Programming · Chapter 1: Overview of computer software & programming languages

- Asked in: 2072 Kartik, 4 marks; 2073 Shrawan, 1+3 marks; 2070 Chaitra, 4 marks; 2073 Chaitra, 3 marks (asked 4 times)
- Video: [The Generations of Programming Languages | Computer Science History](https://www.youtube.com/watch?v=ZFIeEV2HfPQ) — ForrestKnight
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_1/computer_programming/generations-programming-languages
- Whole chapter: https://www.bctengineer.com/md/semester_1/computer_programming/chapter-1

## Question

Explain the generations of programming languages.

## Short answer

Programming languages are grouped into five generations: 1GL (machine language, binary), 2GL (assembly, mnemonics), 3GL (high-level, portable like C), 4GL (non-procedural like SQL), and 5GL (AI languages like Prolog). Each generation is more human-oriented, but higher generations are usually slower and give less hardware control.

## Answer

Programming languages are grouped into five generations, from machine-oriented to human-oriented.

| Generation | Name | Features | Example |
|---|---|---|---|
| 1GL | Machine language | Binary 0s and 1s, directly executed by the CPU, machine dependent, very hard to write | `10110000 01100001` |
| 2GL | Assembly language | Mnemonics (MOV, ADD) translated by an assembler, machine dependent | 8085/8086 assembly |
| 3GL | High-level language | English-like statements, portable, needs compiler or interpreter | C, C++, Java, FORTRAN, Pascal |
| 4GL | Very high-level / non-procedural | You state *what* is wanted, not *how*; used for databases and reports | SQL, report generators |
| 5GL | Artificial-intelligence languages | Problems solved by constraints and logic instead of algorithms | Prolog, Mercury, OPS5 |

- Each generation is easier to read and write than the previous one.
- Higher generations are more portable but usually slower and give less control over hardware.
- Programs written in 2GL and above must be translated to machine code before the computer can run them.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Which generation uses mnemonics such as MOV and ADD translated by an assembler?
   A. 2GL
   B. 1GL
   C. 3GL
   D. 4GL
   Answer: A. Assembly language is the second generation; mnemonics are translated to machine code by an assembler. (Key point: Assembly (2GL))

2. What best describes a fourth-generation language such as SQL?
   A. You write binary 0s and 1s directly
   B. You state what is wanted, not how to get it
   C. You write detailed step-by-step algorithms for the CPU
   D. You solve problems with constraints and logic only
   Answer: B. 4GLs are non-procedural: the user specifies the goal and the system decides how. (Key point: 4GL nature)

3. Prolog belongs to the fifth generation because it
   A. uses English-like procedural statements
   B. is executed directly by the CPU
   C. solves problems using constraints and logic instead of algorithms
   D. is translated by an assembler
   Answer: C. 5GLs are AI languages built on constraints and logic. (Key point: 5GL nature)

4. What is the usual trade-off of moving to higher generations?
   A. Faster and with more hardware control
   B. Machine dependent but easier to write
   C. Harder to read but more portable
   D. More portable and easier, but usually slower with less hardware control
   Answer: D. Higher generations are easier and more portable but give up speed and low-level control. (Key point: Trade-off of higher generations)

## Related in Computer Programming

- [Categories of programming languages](https://www.bctengineer.com/question.md?key=semester_1%2Fcomputer_programming%3Acategorise-languages) — Computer Programming, chapter 1
- [High level vs low level languages](https://www.bctengineer.com/question.md?key=semester_1%2Fcomputer_programming%3Ahigh-low-level-languages) — Computer Programming, chapter 1, asked 2×
- [High level languages; C versus FORTRAN](https://www.bctengineer.com/question.md?key=semester_1%2Fcomputer_programming%3Ahll-types-c-vs-fortran) — Computer Programming, chapter 1
- [High level languages and natural language](https://www.bctengineer.com/question.md?key=semester_1%2Fcomputer_programming%3Ahll-similar-natural-language) — Computer Programming, chapter 1

## Related in other subjects

- [Libraries, system software, languages, OO](https://www.bctengineer.com/question.md?key=semester_8%2Fmultimedia_system%3Alibraries-system-software-languages-oo) — Multimedia System, chapter 7
