Good. We move fast.
Topic 1 — C++ Foundations (Zero → Exam Level)
These basics often appear in MCQ + short answers.
1. Keywords
Reserved words in C++ with fixed meaning.
Examples:
intfloatifelsewhileforreturn
Exam Definition:
Keywords are reserved words in C++ that have predefined meaning and cannot be used as variable names.
2. Identifiers
Names given to variables, functions, arrays, classes.
Example:
1int age;
2float salary;Here:
age= identifiersalary= identifier
Rules:
- Start with letter or
_ - No spaces
- No special chars
- Cannot be keyword
Valid:
sum
_data
marks1
Invalid:
1sum
for
my-data
Exam Definition:
Identifiers are user-defined names used to identify variables, functions, arrays, etc.
3. Constants
Fixed values that do not change.
Examples:
110
23.14
3'A'
4"Hello"Types:
- Integer constant
- Float constant
- Character constant
- String constant
Exam Definition:
A constant is a value that remains unchanged during program execution.
4. Variables
Memory location storing data.
1int a = 10;a = variable.
Definition:
A variable is a named memory location used to store data.
5. Data Types
Tell compiler what kind of data.
Main types:
| Type | Meaning | Example |
|---|---|---|
| int | integer | 10 |
| float | decimal | 3.5 |
| char | character | A |
| double | large decimal | 12.567 |
| bool | true/false | true |
6. Operators
Used to perform operations.
Arithmetic
+ - * / %
Relational
== != > < >= <=
Logical
&& || !
Assignment
=
7. Input / Output
1cin >> a;
2cout << a;cin→ inputcout→ output
8. #include <stdio.h> / basics
PYQ repeated.
It is a preprocessor directive. Used to include standard input-output header file.
Exam line:
#include <stdio.h> is a preprocessor directive used to include standard I/O functions.
9. Small difference (very common)
Keyword vs Identifier
| Keyword | Identifier |
|---|---|
| Reserved word | User-defined name |
| Fixed meaning | Custom meaning |
| Cannot be changed | Created by programmer |
10. Easy MCQs (PYQ style)
Answer fast:
-
foris? → Keyword -
abc1is? → Valid identifier -
3namevalid? → No -
Fixed value? → Constant
-
#include<stdio.h>? → Preprocessor directive
Ultra-short revision
Remember: KIC VDO
- K = Keyword
- I = Identifier
- C = Constant
- V = Variable
- D = Data Type
- O = Operator
Mini test (answer without overthinking):
- Is
whilekeyword or identifier? - Is
_sum1valid identifier? 3.14is what type constant?- Which operator = logical AND?
charstores what?