CSS Computer Science (Optional) — Paper-I, Section-A, Topic II subtopic. Appeared as a past paper question (2017).

Classification by Level

Classification by Translation Method

Classification by Paradigm

Classification by Generation

Generation Description Example
1GL Machine language — raw binary Direct 0/1 instructions
2GL Assembly language — mnemonics MASM, NASM
3GL High-level, procedural C, Pascal, FORTRAN
4GL Closer to human language, often domain-specific (e.g. database queries) SQL
5GL Constraint/goal-based, AI-oriented — program describes the problem, not the steps Prolog

💻 Code Examples: C & C++

The same problem (represent a point and print it) written procedurally in C vs object-oriented in C++ — both are compiled, 3GL, high-level languages, but the paradigm differs:

C (procedural — data and functions are separate):

#include <stdio.h>
struct Point { int x, y; };
void printPoint(struct Point p) {
    printf("(%d, %d)\n", p.x, p.y);
}
int main(void) {
    struct Point p1 = {3, 4};
    printPoint(p1);        // procedural: pass the data to a free-standing function
    return 0;
}
// compiled with: gcc file.c -o file