This is a premium lesson. You can see the shape of every card — unlock to read them.
Unlock
Premium
This card is part of the premium lesson.
Unlock
Constant என்பது program execution நடக்கும் போது அதன் value change ஆகாமல் இ……
Premium
This card is part of the premium lesson.
Unlock
Example
const int MAX = 100; இங்கு: MAX → Constant identifier 10……
Premium
This card is part of the premium lesson.
Unlock
Variable என்றால் value change ஆகலாம். int age = 20; age = 21; இங்கு age value: 20 → 21 என்று change ஆகிறது……
Premium
This card is part of the premium lesson.
Unlock
Real-life example
Mathematics-ல்: π = 3.14159... π-ன் value fixed. அத……
Premium
This card is part of the premium lesson.
Unlock
Why constants are needed
Program-ல் சில values change ஆகக்கூடாது. PI Number of days in a week Maximum marks Tax rate Conversion value ……
Premium
This card is part of the premium lesson.
Unlock
Premium
This card is part of the premium lesson.
Unlock
const int MAX_MARK = 100; const C++ keyword. Compiler-க்கு: இந்த variable-ன் value later change செய்யக……
Premium
This card is part of the premium lesson.
Unlock
What happens if we change it?
const int MAX = 100; MAX = 200; இது invalid. Comp……
Premium
This card is part of the premium lesson.
Unlock
Comparison
Variable vs constant
Variable int x = 10; x = 20; V……
Premium
This card is part of the premium lesson.
Unlock
Types of constant values / literals
C++-ல் fixed values பல types-ல் இருக்கலாம். Main types: Int……
Premium
This card is part of the premium lesson.
Unlock
INTEGER CONSTANT
Decimal point இல்லாத whole number values. Examples: 10 100 ……
Premium
This card is part of the premium lesson.
Unlock
Integer constant examples
const int DAYS = 7; const int MONTHS = 1……
Premium
This card is part of the premium lesson.
Unlock
FLOATING-POINT CONSTANT
Decimal point கொண்ட numbers. ……
Premium
This card is part of the premium lesson.
Unlock
Example
Premium
This card is part of the premium lesson.
Unlock
3.14 → Floating-point literal.
Double constant
const double PI = 3.14159265; Her……
Premium
This card is part of the premium lesson.
Unlock
CHARACTER CONSTANT
Single character-ஐ single quotation marks ' ' குள் எழு……
Premium
This card is part of the premium lesson.
Unlock
Character: 'A' Single quotes. S……
Premium
This card is part of the premium lesson.
Unlock
STRING LITERAL
Multiple characters-ஐ double quotation mar……
Premium
This card is part of the premium lesson.
Unlock
Example
string name = "Ravi"; "Ravi" → String lite……
Premium
This card is part of the premium lesson.
Unlock
BOOLEAN LITERALS
C++-ல் Boolean literals இரண்டு: tru……
Premium
This card is part of the premium lesson.
Unlock
Comparison
Literal vs const constant
இந்த concept மிகவும் important. Consider: const int MAX = 100; இதில்: const → Keyword MAX → Identifier 100 → ……
Premium
This card is part of the premium lesson.
Unlock
Example
int x = 50; 50 ஒரு integer literal. ஆனால் x constant அல்ல. Beca……
Premium
This card is part of the premium lesson.
Unlock
Constant initialization
Normally const variable declare செய்யும்போதே initialize செய்வது வேண்டும். Correct: co……
Premium
This card is part of the premium lesson.
Unlock
Declare constant | v const int MAX = 100; | v Value ……
Premium
This card is part of the premium lesson.
Unlock
Program 2
double radius = 5; double are……
Premium
This card is part of the premium lesson.
Unlock
Premium
This card is part of the premium lesson.
Unlock
Premium
This card is part of the premium lesson.
Unlock
const double PI = 3.14159; PI constant. double ra……
Premium
This card is part of the premium lesson.
Unlock
Area = πr² So: 3.14159 × 5 × ……
Premium
This card is part of the premium lesson.
Unlock
Program
const int MAX = 100; int mark……
Premium
This card is part of the premium lesson.
Unlock
Step 1
Premium
This card is part of the premium lesson.
Unlock
Variable. Step 3: Program pri……
Premium
This card is part of the premium lesson.
Unlock
Premium
This card is part of the premium lesson.
Unlock
Symbolic constants
Older C/C++ code-ல் #define மூலம் symbolic constants உருவாக்கப்படலாம்……
Premium
This card is part of the premium lesson.
Unlock
Comparison
Const vs #define
Modern C++-ல் பொதுவாக typed c……
Premium
This card is part of the premium lesson.
Unlock
Example
const double PI = 3.14; compa……
Premium
This card is part of the premium lesson.
Unlock
Comparison
Difference
Constexpr - important advanced point
Modern C++-ல்: constexpr int SIZE = 10; constexpr என்பது ……
Premium
This card is part of the premium lesson.
Unlock
Example
constexpr int DAYS = 7; For basics: const → value cannot be modified through that const obj……
Premium
This card is part of the premium lesson.
Unlock
Naming convention
Constants-க்கு uppercase names பயன்படுத்துவது common convention. const int MAX_SIZE = 100; const ……
Premium
This card is part of the premium lesson.
Unlock
Common error 1
const int MAX = 100; MAX = 200;……
Premium
This card is part of the premium lesson.
Unlock
Common error 2
const int MAX; Local const object-க்கு in……
Premium
This card is part of the premium lesson.
Unlock
Common error 3
Character மற்றும் string confuse செய்வது. Wr……
Premium
This card is part of the premium lesson.
Unlock
Common error 4
Constant name uppercase-ல் இருக்க வேண்டும் என்பது compulsory ……
Premium
This card is part of the premium lesson.
Unlock
Important difference
Consider: const int x = 10; இதை token-wise பார்க்கலாம்: const → Keyword int → Keyword / type specifie……
Premium
This card is part of the premium lesson.
Unlock
Example
const int A = 10; const int B……
Premium
This card is part of the premium lesson.
Unlock
C-ன் value initialization முட……
Premium
This card is part of the premium lesson.
Unlock
const என்பது ஒரு type qualifi……
Premium
This card is part of the premium lesson.
Unlock
Example
const int x = 10; இதில் const compi……
Premium
This card is part of the premium lesson.
Unlock
CONST = CONSTANT = CANNOT CHANGE V……
Premium
This card is part of the premium lesson.
Unlock
Example
int x = 10; Change possible. ……
Premium
This card is part of the premium lesson.
Unlock
Question
What is a constant in C++? Answer: A constant is a fixed v……
Premium
This card is part of the premium lesson.
Unlock
const int x = 10; Which state……
Premium
This card is part of the premium lesson.
Unlock
Difference between constant and literal? Consider: const int MAX = 100; MAX → named constant ……
Premium
This card is part of the premium lesson.
Unlock
Which keyword is commonly use……
Premium
This card is part of the premium lesson.
Unlock
Premium
This card is part of the premium lesson.
Unlock
In: const int MAX = 100; 100 ……
Premium
This card is part of the premium lesson.
Unlock
In: const int MAX = 100; MAX ……
Premium
This card is part of the premium lesson.
Unlock
Which is a floating-point lit……
Premium
This card is part of the premium lesson.
Unlock
Which is a character literal?…
Premium
This card is part of the premium lesson.
Unlock
Which are Boolean literals in……
Premium
This card is part of the premium lesson.
Unlock
What happens here? const int ……
Premium
This card is part of the premium lesson.
Unlock
Practice
Identify each part: const double RATE = 5.5; Answer: cons……
Premium
This card is part of the premium lesson.
Unlock
5.5 → Floating-point literal
Premium
This card is part of the premium lesson.
Unlock
Practice
Practice 2
Which can be changed? int x = 10; const int y = 20; Answer:……
Premium
This card is part of the premium lesson.
Unlock
Constant A fixed value that d……
Premium
This card is part of the premium lesson.
Unlock
Syntax
const data_type name = value; const int MAX = 100; Breakdown: const → K……
Premium
This card is part of the premium lesson.
Unlock
3.14 → Floating point
'A' → Character "Hello" → String true → Boolean Most important exam difference: int x = 10; x ……
Premium
This card is part of the premium lesson.
Unlock