SlideShare a Scribd company logo
4
Most read
5
Most read
8
Most read
C tokens
In a passage of text, individual words and punctuation
marks are called tokens. Similarly, in C programming the
smallest individual units are known as C tokens.
C language has six types of tokens, and programs are
written using these tokens and the syntax of the
language.
Keywords Identifiers Constants Strings
Special
Symbols
Operators
 Keywords serves as the building blocks for a program statements. All
keywords have a fixed meaning and cannot be changed.
 Keywords cannot be used as normal identifier names.
Few Examples of keywords used in C are listed below
 int
 break
 goto
 char
 switch
 void
 Identifier refers to the name of variables, functions and arrays. These are
user defined names and consists of a sequence of letters and digits.
 Both uppercase and lowercase letters can be used, and c language is case
sensitive. A special symbol underscore ( _ ) is also permitted.
Rules For Identifiers
 First character must be an alphabet.
 must consist of only letters, digits or underscore.
 Should not be a keyword and should not have any blank space.
 Example:- int num;
char name;
Where num and name are identifier names.
 Constants refers to fixed values that do not change during the execution of
a program.
Basic types of C constants are shown in the flowchart
Constants
Numeric
Constants
Integer
Constants
Real
Constants
Character
Constants
Single
character
constants
String
constants
 Strings are nothing but array of characters ended with null character (‘0’).
This null character indicates the end of the string.
Strings are always enclosed by double quotes. Whereas, character is
enclosed by single quotes in C.
 Example :- char name[10];
In this example the variable name can store up to 10 bytes.
 The following special symbols are used in C having some special meaning
and thus, cannot be used for some other purpose.
[] () {} , ; : * … = #
Braces{}: These opening and ending curly braces marks the start and end of
a block of code containing more than one executable statement.
Parentheses(): These special symbols are used to indicate function calls and
function parameters.
Brackets[]: Opening and closing brackets are used as array element
reference. These indicate single and multidimensional subscripts.
 The symbols which are used to perform logical and mathematical
operations in a C program are called C operators.
Operators used in C program are
 Arithmetic operators
 Assignment operators
 Relational operators
 Logical operators
 Bit wise operators
 Conditional operators (ternary operators)
 Increment/decrement operators
 Special Operators
C tokens

More Related Content

PPTX
C Tokens
PPTX
DOCX
Basic structure of c programming
PPTX
Programming in C Presentation upto FILE
PPT
C program
PPT
constants, variables and datatypes in C
PPTX
Data types in C
PPT
Introduction to c programming
C Tokens
Basic structure of c programming
Programming in C Presentation upto FILE
C program
constants, variables and datatypes in C
Data types in C
Introduction to c programming

What's hot (20)

PPT
Operators in C Programming
PPTX
Data types
PPTX
data types in C programming
PPT
Constants in C Programming
PPTX
Functions in c language
PPT
Variables in C Programming
PPTX
Character set of c
PPT
Structure of a C program
PPTX
Data Types and Variables In C Programming
PPTX
Programming in c Arrays
PPTX
Control statements in c
PPTX
Data types in C
PPTX
Algorithm and flowchart
PPT
Operator Overloading
PPTX
Structure in C
PPTX
Structures in c language
PPTX
Presentation on C Switch Case Statements
PPTX
Data Type in C Programming
PPT
Basics of C programming
PPTX
Union in c language
Operators in C Programming
Data types
data types in C programming
Constants in C Programming
Functions in c language
Variables in C Programming
Character set of c
Structure of a C program
Data Types and Variables In C Programming
Programming in c Arrays
Control statements in c
Data types in C
Algorithm and flowchart
Operator Overloading
Structure in C
Structures in c language
Presentation on C Switch Case Statements
Data Type in C Programming
Basics of C programming
Union in c language
Ad

Viewers also liked (20)

PPT
Tokens_C
ODP
About Tokens and Lexemes
PPTX
Operator in c programming
PPTX
C language ppt
PPT
Token system powerpoint
PPTX
Recognition-of-tokens
PPTX
Function in C program
PPTX
What is token c programming
PPTX
What is keyword in c programming
PPTX
Input-Buffering
PPTX
Specification-of-tokens
PPTX
Algorithms and Flowcharts
PPT
Chapter3
PDF
Autenticação baseada em token com jwt
PPTX
Token economies
PPT
Ed457 tokeneconomy
PDF
7. input and output functions
PPTX
Concept of c data types
PDF
Escape sequences
PPT
Data type in c
Tokens_C
About Tokens and Lexemes
Operator in c programming
C language ppt
Token system powerpoint
Recognition-of-tokens
Function in C program
What is token c programming
What is keyword in c programming
Input-Buffering
Specification-of-tokens
Algorithms and Flowcharts
Chapter3
Autenticação baseada em token com jwt
Token economies
Ed457 tokeneconomy
7. input and output functions
Concept of c data types
Escape sequences
Data type in c
Ad

Similar to C tokens (20)

PPTX
C tokens.pptx
PPTX
Tokens.pptx
PPTX
Complete Tokens in c/c++
PDF
C PADHLO FRANDS.pdf
PPTX
Features and Fundamentals of C Language for Beginners
PDF
C Programming Language Introduction and C Tokens.pdf
PPTX
C Programming - Basics of c -history of c
PPT
history of c.ppt
DOCX
C and DS -unit 1 -Artificial Intelligence and ML.docx
PPT
Basics of C
PPTX
Introduction of Basics of c programming.pptx
PPTX
Basics of C Programming Language Introduction.pptx
PPTX
C Tokens.pptx,,,,,.............,.............36#&+88....7£+-(;-£+;(+"-:;3!("+...
PPT
Basics of C.ppt
PPSX
Programming in c
PPTX
unit2.pptx
PPT
Basics of c
PPT
Basic of c language
PPT
Intro Basics of C language Operators.ppt
PPT
Basics of C.ppt
C tokens.pptx
Tokens.pptx
Complete Tokens in c/c++
C PADHLO FRANDS.pdf
Features and Fundamentals of C Language for Beginners
C Programming Language Introduction and C Tokens.pdf
C Programming - Basics of c -history of c
history of c.ppt
C and DS -unit 1 -Artificial Intelligence and ML.docx
Basics of C
Introduction of Basics of c programming.pptx
Basics of C Programming Language Introduction.pptx
C Tokens.pptx,,,,,.............,.............36#&+88....7£+-(;-£+;(+"-:;3!("+...
Basics of C.ppt
Programming in c
unit2.pptx
Basics of c
Basic of c language
Intro Basics of C language Operators.ppt
Basics of C.ppt

Recently uploaded (20)

PDF
III.4.1.2_The_Space_Environment.p pdffdf
PPTX
Safety Seminar civil to be ensured for safe working.
PDF
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
PPT
introduction to datamining and warehousing
PDF
Visual Aids for Exploratory Data Analysis.pdf
PPT
Occupational Health and Safety Management System
PDF
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
PDF
737-MAX_SRG.pdf student reference guides
PDF
Categorization of Factors Affecting Classification Algorithms Selection
PDF
UNIT no 1 INTRODUCTION TO DBMS NOTES.pdf
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PDF
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
PPTX
Information Storage and Retrieval Techniques Unit III
PPTX
Fundamentals of safety and accident prevention -final (1).pptx
PDF
Soil Improvement Techniques Note - Rabbi
PDF
null (2) bgfbg bfgb bfgb fbfg bfbgf b.pdf
III.4.1.2_The_Space_Environment.p pdffdf
Safety Seminar civil to be ensured for safe working.
Level 2 – IBM Data and AI Fundamentals (1)_v1.1.PDF
introduction to datamining and warehousing
Visual Aids for Exploratory Data Analysis.pdf
Occupational Health and Safety Management System
Artificial Superintelligence (ASI) Alliance Vision Paper.pdf
R24 SURVEYING LAB MANUAL for civil enggi
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
737-MAX_SRG.pdf student reference guides
Categorization of Factors Affecting Classification Algorithms Selection
UNIT no 1 INTRODUCTION TO DBMS NOTES.pdf
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
BIO-INSPIRED HORMONAL MODULATION AND ADAPTIVE ORCHESTRATION IN S-AI-GPT
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
6ME3A-Unit-II-Sensors and Actuators_Handouts.pptx
Information Storage and Retrieval Techniques Unit III
Fundamentals of safety and accident prevention -final (1).pptx
Soil Improvement Techniques Note - Rabbi
null (2) bgfbg bfgb bfgb fbfg bfbgf b.pdf

C tokens

  • 2. In a passage of text, individual words and punctuation marks are called tokens. Similarly, in C programming the smallest individual units are known as C tokens. C language has six types of tokens, and programs are written using these tokens and the syntax of the language.
  • 3. Keywords Identifiers Constants Strings Special Symbols Operators
  • 4.  Keywords serves as the building blocks for a program statements. All keywords have a fixed meaning and cannot be changed.  Keywords cannot be used as normal identifier names. Few Examples of keywords used in C are listed below  int  break  goto  char  switch  void
  • 5.  Identifier refers to the name of variables, functions and arrays. These are user defined names and consists of a sequence of letters and digits.  Both uppercase and lowercase letters can be used, and c language is case sensitive. A special symbol underscore ( _ ) is also permitted. Rules For Identifiers  First character must be an alphabet.  must consist of only letters, digits or underscore.  Should not be a keyword and should not have any blank space.  Example:- int num; char name; Where num and name are identifier names.
  • 6.  Constants refers to fixed values that do not change during the execution of a program. Basic types of C constants are shown in the flowchart Constants Numeric Constants Integer Constants Real Constants Character Constants Single character constants String constants
  • 7.  Strings are nothing but array of characters ended with null character (‘0’). This null character indicates the end of the string. Strings are always enclosed by double quotes. Whereas, character is enclosed by single quotes in C.  Example :- char name[10]; In this example the variable name can store up to 10 bytes.
  • 8.  The following special symbols are used in C having some special meaning and thus, cannot be used for some other purpose. [] () {} , ; : * … = # Braces{}: These opening and ending curly braces marks the start and end of a block of code containing more than one executable statement. Parentheses(): These special symbols are used to indicate function calls and function parameters. Brackets[]: Opening and closing brackets are used as array element reference. These indicate single and multidimensional subscripts.
  • 9.  The symbols which are used to perform logical and mathematical operations in a C program are called C operators. Operators used in C program are  Arithmetic operators  Assignment operators  Relational operators  Logical operators  Bit wise operators  Conditional operators (ternary operators)  Increment/decrement operators  Special Operators