Skip to content
Computer Aptitude · 1 Q

Computer Languages

Read the notes once, then practise. Every question shows the full solution right after you answer.

Study notes

Generations of programming languages

GenerationTypeFeaturesExamples
1GLMachine languageBinary 0s and 1s; only language the CPU understands directly; machine dependent; fastest; no translatorBinary op-codes
2GLAssembly languageMnemonics (ADD, MOV, SUB); needs an assembler; machine dependentx86 assembly
3GLHigh-level (procedural)English-like; machine independent; needs compiler/interpreterFORTRAN, COBOL, BASIC, C, C++, Java, Python
4GLVery high-level / non-proceduralSay what you want, not how; database and report toolsSQL, report generators
5GLLogic / constraint basedUsed in AI and expert systemsProlog, Mercury

1GL and 2GL are low-level languages; 3GL onwards are high-level languages.

Language translators and tools

ToolJob
AssemblerAssembly language → machine code
CompilerTranslates the whole high-level program at once; lists all errors after compiling; produces object code; execution is faster
InterpreterTranslates and executes line by line; stops at the first error; no separate object file
LinkerCombines object files and library code into one executable
LoaderLoads the executable into memory for running
DebuggerHelps find and fix bugs
IDEIntegrated Development Environment – editor, compiler and debugger together

Source code is what the programmer writes; object code is the translated machine code. Java uses both: the compiler produces bytecode, which the JVM (Java Virtual Machine) runs – "write once, run anywhere".

Languages and their creators

LanguageCreator / yearKnown for
FORTRANJohn Backus, IBM (1957)Formula Translation; scientific and engineering work; early widely used high-level language
COBOLCODASYL committee (1959), influenced by Grace HopperCommon Business-Oriented Language; banking and business data
LISPJohn McCarthy (1958)AI research, list processing
BASICKemeny and Kurtz (1964)Beginner's All-purpose Symbolic Instruction Code
PascalNiklaus Wirth (1970)Teaching structured programming
CDennis Ritchie, Bell Labs (1972)System programming; Unix was rewritten in C
C++Bjarne Stroustrup (1983/85)C with classes; object-oriented
PythonGuido van Rossum (1991)Simple syntax; data science, AI, scripting
JavaJames Gosling, Sun Microsystems (1995)Platform independent; Android apps, enterprise and banking systems
JavaScriptBrendan Eich, Netscape (1995)Interactive web pages in the browser
PrologAlain Colmerauer (1972)Logic programming, AI

HTML (HyperText Markup Language) is a markup language for structuring web pages, not a programming language. CSS styles pages; XML stores and transports data with user-defined tags.

Object-oriented programming (OOP)

  • Class – blueprint; object – instance of a class.
  • Encapsulation – wrapping data and methods together; data hiding.
  • Inheritance – a class acquires properties of another (parent) class.
  • Polymorphism – one name, many forms (overloading, overriding).
  • Abstraction – showing essential features and hiding details.

OOP languages: C++, Java, Python, C#. C is procedural.

Errors

  • Syntax error – breaks grammar rules (missing semicolon); caught by the compiler.
  • Logical error – program runs but gives wrong output; hardest to detect.
  • Runtime error – occurs while running (division by zero).

An error in a program is a bug; removing it is debugging.

Algorithms and flowcharts

Flowchart symbolMeaning
Oval (terminal)Start / End
ParallelogramInput / Output
RectangleProcess
DiamondDecision (Yes/No)
ArrowFlow of control
Small circleConnector

An algorithm is a finite, step-by-step procedure to solve a problem; pseudocode writes it in plain, code-like English.

Exam tip: Compiler = whole program at once; interpreter = line by line; assembler = assembly only. SQL = 4GL, Prolog = 5GL.
Free SBI Clerk practice with solutionsStart free →