DEFINITION OF SOME COMMON TERMS:
Programming: Programming is the process of designing and writing instructions (code) that a computer
can follow to perform specific tasks. It involves using a programming language to create algorithms that
solve problems or perform calculations.
Algorithm: An algorithm is a step-by-step procedure or set of rules for solving a problem or accomplishing
a task. It’s like a recipe that outlines each action needed to achieve the desired result. Algorithms are
essential in programming to create efficient and logical solutions.
C++: C++ is a high-level programming language that supports both procedural and object-oriented
programming. Developed as an extension of C, it allows for more complex data structures and features
like classes and inheritance, which facilitate code reusability and modularity.
Data Types: Data types define the kind of data that can be stored in a variable, such as integer, float
(decimal), char (character), or boolean (true/false). They help determine the operations that can be
performed on data and how much memory is allocated to store it.
5. Variables: Variables are named storage locations in memory that hold data values. They act as
containers for data and can store different types of values as defined by their data types. In programming,
variables are used to store, modify, and retrieve data.
6. Arithmetic Operators: Arithmetic operators are symbols used in programming to perform
mathematical operations like addition (`+`), subtraction (`-`), multiplication (`*`), division (`/`), and
modulus (`%`), which returns the remainder of a division.
7. Assignment Operator: The assignment operator (`=`) is used to assign a value to a variable. For example,
`x = 5` assigns the value `5` to the variable `x`. Other compound assignment operators, like `+=` and `*=`,
modify and assign values in one step.
8. Logical Operators: Logical operators are used to perform logical operations and compare values.
Common logical operators are `&&` (logical AND), `||` (logical OR), and `!` (logical NOT). They are often
used in conditional statements to make decisions.
9. Control Statements - "If" Statement: The `if` statement is a control structure that allows a program to
execute a block of code only if a specified condition is true. It’s used for decision-making, enabling a
program to branch and perform different actions based on certain conditions.
PROCESS OF COMPILATION:
In C++, the process from writing code to compilation involves several stages: first, the programmer writes
source code in a .cpp file. During preprocessing, preprocessor directives like #include and #define
are expanded. The compiler then translates this preprocessed code into assembly language, performing
syntax checks, optimizations, and ensuring logical structure. Next, an assembler converts the assembly
code into object code (machine-readable but incomplete), saved as a .o file. Finally, the linker combines
object files and libraries into a single executable file that the computer can run directly.