TOKENS IN C++ TRB CSI › Programming with C++ › Covers tokens

TOKENS IN C++

Token என்பது C++ program-ல் compiler புரிந்து கொள்ளும் smallest meaningful unit. Simple Tamil: C++ program-ஐ compiler ஒரே பெரிய sentence மாதிரி பார்க்காது. அதை சிறிய சிறிய meaningful parts-ஆக பிரித்து புரிந்து கொள்கிறது. அந்த smallest part…

Premium — locked Advanced 16 min 75 cards 11 programs 7 MCQs v2
This is a premium lesson. You can see the shape of every card — unlock to read them. Unlock

TOKENS IN C++…

Premium This card is part of the premium lesson. Unlock
Definition

Token என்பது C++ program-ல் compiler புரிந்து கொள்ளும் smallest meaningful unit. Simple Tamil: C++ p……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

int total = 10 + 20; இதில் உள்ள to……

Premium This card is part of the premium lesson. Unlock
Simple Explanation

English sentence: I am a student இதில் words தனித்தனி meaning கொண்டவை. அதேபோல் C++: int age = 25; இதில்: int ……

Premium This card is part of the premium lesson. Unlock

KEYWORDS

Definition

Compiler-க்கு ஏற்கனவே predefi……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

int float double char if else for while return class public private int age = 20; இங்……

Premium This card is part of the premium lesson. Unlock
Important

Keyword-ஐ variable name ஆக பயன்படுத்த முடியாது. Wrong:……

Premium This card is part of the premium lesson. Unlock

IDENTIFIERS

Definition

Programmer உருவாக்கும் பெயர்கள் Identifiers. Variabl……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

int marks = 90; இதில்: marks ஒரு identifier. Examples int age; float salary; char grade; Identifiers: age sal……

Premium This card is part of the premium lesson. Unlock

CONSTANTS / LITERALS

Definition

Program-ல் directly எழுதப்படு……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

int age = 25; இங்கு: 25 literal. TYPES OF LITERALS Integer Literal Whole numbers. 1……

Premium This card is part of the premium lesson. Unlock

25.50 → Floating-point literal.

Character Literal Single charac……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

char grade = 'A'; 'A' → character literal. String L……

Premium This card is part of the premium lesson. Unlock
Program
Example
Explanation

"Hello" → String literal. Boolean Litera……

Premium This card is part of the premium lesson. Unlock

STRINGS

Definition

Characters-ன் sequence double……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

"Hello World" Character vs Strin……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

char grade = 'A'; string name……

Premium This card is part of the premium lesson. Unlock

OPERATORS

Definition

Values அல்லது variables மீது oper……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

a + b இதில்: + operator. COMM……

Premium This card is part of the premium lesson. Unlock
List

- Addition - Subtraction - Mu……

Premium This card is part of the premium lesson. Unlock
Explanation

/ Division % Modulus int resu……

Premium This card is part of the premium lesson. Unlock
Definition
Meaning

10 value-ஐ x-க்கு assign செய்.…

Premium This card is part of the premium lesson. Unlock
Important

= Assignment == Comparison இர……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

age >= 18 Logical Operators && AND || OR ! NOT age……

Premium This card is part of the premium lesson. Unlock

PUNCTUATORS / SPECIAL SYMBOLS

Explanation

C++ program structure உருவாக்க பயன்படும் special symbols Punctuators. Examples: ; , () {} [] : . SEMICOLON ; ……

Premium This card is part of the premium lesson. Unlock
Program
Example
Explanation

அல்லது: main() CURLY BRACES {……

Premium This card is part of the premium lesson. Unlock
Explanation

Mostly arrays-ல் பயன்படுத்தப்படும். int marks[5]; COMMA , Multipl……

Premium This card is part of the premium lesson. Unlock
Explanation

Total: 5 tokens ANOTHER EXAMPLE float pri……

Premium This card is part of the premium lesson. Unlock
Program
Tokens conceptually
Explanation

return 0; } Important tokens ……

Premium This card is part of the premium lesson. Unlock
Explanation

Compiler-ன் ஆரம்ப stages-ல் source program tokens-ஆக பிரிக்கப்படுகிறது. i……

Premium This card is part of the premium lesson. Unlock
List

- → operator…

Premium This card is part of the premium lesson. Unlock
Explanation

b → identifier ; → punctuator இந்த token identification process compiler-ன் Lexical Analysis stage-இன் முக்கி……

Premium This card is part of the premium lesson. Unlock
Explanation

WHITE SPACE AND TOKENS int age=20; மற்றும்: int age = 20; இரண்டும் compiler-க்கு பொதுவாக same meani……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Error 1

int 2marks; Wrong because ident……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Error 2

int for; Wrong because for ke……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Error 3

char grade = "A"; "A" string ……

Premium This card is part of the premium lesson. Unlock
Common Mistake
Error 4

int a = 10 Semicolon missing.……

Premium This card is part of the premium lesson. Unlock
Important

Token is the smallest meaningful unit of a program. Keywords have predefined meaning. Identifiers are user-de……

Premium This card is part of the premium lesson. Unlock
Practice
Assignment.

x == 10…

Premium This card is part of the premium lesson. Unlock
Comparison
Comparison.

'A' vs "A" 'A' Character literal. "A" String li……

Premium This card is part of the premium lesson. Unlock
Remember

K I C S O P K → Keyword I → Identif……

Premium This card is part of the premium lesson. Unlock
TRB Point

Question: What is a token in C++? Answer: A token is ……

Premium This card is part of the premium lesson. Unlock
Interview Point

For: int x = 25; Ask: "How many main……

Premium This card is part of the premium lesson. Unlock
MCQ

The smallest meaningful unit ……

Premium This card is part of the premium lesson. Unlock
MCQ

Which is a keyword?…

Premium This card is part of the premium lesson. Unlock
MCQ

Which is a valid identifier?…

Premium This card is part of the premium lesson. Unlock
MCQ

In the statement int x = 10;,……

Premium This card is part of the premium lesson. Unlock
MCQ

Which one is a character lite……

Premium This card is part of the premium lesson. Unlock
MCQ

In a + b, + is:…

Premium This card is part of the premium lesson. Unlock
MCQ

Which symbol normally termina……

Premium This card is part of the premium lesson. Unlock
Practice

Identify every token: double salary = 25000.50; Answer: doub……

Premium This card is part of the premium lesson. Unlock
Summary

C++ Token = compiler recognize செய்யும் smallest meaningful program element. M……

Premium This card is part of the premium lesson. Unlock
Explanation
Example

int marks = 90; இதில்: int → Keyword marks → Identifi……

Premium This card is part of the premium lesson. Unlock
Text size
17px
Theme
Contents
Print / PDF
Program