Michael Thomas

Homepage Photo

Basic Computer Notes for MPSC

Share

PROGRAMMING LANGUAGES

A computer system is simply a machine and, by itself, it cannot perform any task or work. In order to make a computer functional, it must be provided with a set of instructions.

These instructions are written using special languages known as Programming Languages, or simply Computer Languages.

A programming language allows humans to communicate with computers and instruct them to perform specific tasks.

LANGUAGE AND SYNTAX

Every programming language has its own:

  • Vocabulary – The set of words and symbols used in the language.
  • Rules – The rules that determine how the words and symbols must be arranged.

These rules are known as Syntax.

Syntax: The set of rules that defines the correct structure of statements and instructions in a programming language.

MAJOR CATEGORIES OF PROGRAMMING LANGUAGES

Programming languages can be broadly classified into the following categories:

  1. Machine Language
  2. Assembly Language
  3. High-Level Language
  4. System Language
  5. Scripting Language

PROGRAMMING LANGUAGES

1. MACHINE LANGUAGE OR MACHINE CODE

Machine Language is the lowest-level programming language.

It consists of instructions written in the form of binary code, using only:

  • 0
  • 1

Machine language is written directly for computer hardware and is executed directly by the Central Processing Unit (CPU).

Features

  • Directly understood by the computer.
  • Executed directly by the CPU.
  • Does not require a translator.
  • Very difficult for humans to read and write.
  • Machine-dependent.

HUMAN INSTRUCTION

BINARY CODE

0   1   0   1

CPU

EXECUTION

2. ASSEMBLY LANGUAGE

Assembly Language is a low-level programming language that uses symbolic codes or mnemonics to represent machine-language instructions.

It is an encoded form of machine code that makes programming easier and more readable for humans.

Examples of common assembly language mnemonics include:

  • ADD
  • SUB
  • MOV
  • JMP

Assembly language requires an Assembler to convert the instructions into machine language.

ASSEMBLY LANGUAGE

MOV, ADD, SUB

ASSEMBLER

MACHINE LANGUAGE

0s and 1s

CPU

3. HIGH-LEVEL LANGUAGE

A High-Level Language is a programming language that is relatively simple and easy for humans to understand.

It is generally closer to the English language than machine language or assembly language.

High-level languages allow programmers to write instructions using words and expressions that are easier to read and understand.

Examples

  • COBOL
  • FORTRAN
  • BASIC
  • C
  • C++
  • Python

Note: High-level languages require a translator, such as a compiler or interpreter, to convert the instructions into machine-understandable code.

HIGH-LEVEL LANGUAGE

(Human-readable)

Compiler / Interpreter

MACHINE LANGUAGE

CPU

LEVELS OF PROGRAMMING LANGUAGES

Programming languages can also be understood in terms of their closeness to computer hardware:

MORE HUMAN-FRIENDLY

HIGH-LEVEL LANGUAGE

ASSEMBLY LANGUAGE

MACHINE LANGUAGE

MORE HARDWARE-ORIENTED

Quick Comparison

LanguageMain FeatureHuman ReadabilityTranslator
Machine LanguageUses 0s and 1sVery difficultNot required
Assembly LanguageUses symbolic codes/mnemonicsEasier than machine languageAssembler
High-Level LanguageUses human-readable instructionsEasyCompiler/Interpreter

Practice MCQ

1. In a compiler, keywords of a language are recognized during
 (
A): parsing of the program
 (B): code generation
 (C): lexical analysis of the program
 (D): dataflow analysis

Computer Programmer 2024

2. Which programming language is most commonly used for Artificial Intelligence and machine learning applications?
 (A): Java
 (B): Ruby / Lisp
 (C): C++
 (D): Python

INSP LEG-M (APR 2025) / INV DH(Jan-2024)

3. Which of the following does not translate the entire program at once?
 (A)
: Compiler
 (B)
: Interpreter
 (C)
: Assembler
 (D)
: Both (A) and (B)

Liaison Officer (LO) 2025

Answer: (B) Interpreter

A computer can understand which of the following languages directly?
 (A)
English
 (B)
Machine language
 (C)
Assembly language
 (D)
High-level language

Liaison Officer (LO) 2025

Answer: (B)
Explanation
: Machine language is comprised entirely of raw binary code (1s and 0s) and is the only language that a computer’s CPU can directly execute without an intermediate translation step.

4. Which language is directly understood by the computer’s CPU?
(A) High-level language
(B) Assembly language
(C) Machine language
(D) Scripting language
Answer: (C) Machine language

5.Which language uses binary digits (0 and 1)?
(A) Assembly language
(B) Machine language
(C) BASIC
(D) Python
Answer: (B) Machine language

6. Which of the following is a low-level language?
(A) Python
(B) Java
(C) Assembly language
(D) BASIC
Answer: (C) Assembly language

7. Which translator converts assembly language into machine language?
(A) Compiler
(B) Interpreter
(C) Assembler
(D) Linker
Answer: (C) Assembler

8. A compiler translates:
(A) Machine language into assembly language
(B) The entire high-level language program at once
(C) One statement at a time
(D) Assembly language into machine language
Answer: (B) The entire high-level language program at once

9. An interpreter translates and executes a program:
(A) Entirely at once
(B) One statement or line at a time
(C) Only after compilation
(D) Only into assembly language
Answer: (B) One statement or line at a time

10. Which of the following is a high-level programming language?
(A) Machine language
(B) Assembly language
(C) Python
(D) Binary code
Answer: (C) Python

11. Which of the following is an example of a programming language?
(A) Windows
(B) Python
(C) Keyboard
(D) Printer
Answer: (B) Python

12. Which language is generally easier for humans to understand?
(A) Machine language
(B) High-level language
(C) Binary language
(D) Object code
Answer: (B) High-level language

13. The set of rules that defines the correct structure of statements in a programming language is called:
(A) Algorithm
(B) Syntax
(C) Program
(D) Compiler
Answer: (B) Syntax

14. A program written in a high-level programming language before translation is called:
(A) Object code
(B) Machine code
(C) Source code
(D) Binary code
Answer: (C) Source code

14. The output produced after translating source code is generally called:
(A) Source code
(B) Object code
(C) Algorithm
(D) Syntax
Answer: (B) Object code

16. Which of the following is a programming language developed for scientific and engineering calculations?
(A) FORTRAN
(B) HTML
(C) SQL
(D) XML
Answer: (A) FORTRAN

17. Which of the following is commonly associated with business data processing?
(A) COBOL
(B) FORTRAN
(C) HTML
(D) BASIC
Answer: (A) COBOL

18. Which of the following is an example of a scripting language?
(A) JavaScript
(B) Machine language
(C) Assembly language
(D) Binary code
Answer: (A) JavaScript

19. Which of the following is a language processor?
(A) Compiler
(B) Keyboard
(C) Monitor
(D) Printer
Answer: (A) Compiler

20. Which translator translates a program statement by statement and usually stops when it encounters an error?
(A) Compiler
(B) Interpreter
(C) Assembler
(D) Linker
Answer: (B) Interpreter

21. Which of the following is an advantage of a compiler?
(A) It translates only one line at a time
(B) It translates the complete program before execution
(C) It can understand only binary numbers
(D) It is a hardware device
Answer: (B) It translates the complete program before execution

22. Which of the following is NOT a programming language?
(A) Python
(B) Java
(C) C++
(D) Windows
Answer: (D) Windows

23. A step-by-step procedure used to solve a problem before writing a computer program is called:
(A) Algorithm
(B) Compiler
(C) Interpreter
(D) Operating System
Answer: (A) Algorithm

1 thought on “Basic Computer Notes for MPSC”

Leave a Comment