WELCOME TO TODAYSWELCOME TO TODAYS
PRESENTATIONPRESENTATION
ONON
WELCOME TO TODAYSWELCOME TO TODAYS
PRESENTATIONPRESENTATION
ONON
VARIABLES,TOKENVARIABLES,TOKEN & IDENTIFIER& IDENTIFIERVARIABLES,TOKENVARIABLES,TOKEN & IDENTIFIER& IDENTIFIER
BYBY
MEHENAZ KHANMEHENAZ KHAN SORNASORNA
OBJECTIVES
• LITTLE DISCUSSION ABOUT C
PROGRAMMING
• TALK ABOUT VERIABLES
• TALK ABOUT TOKEN• TALK ABOUT TOKEN
• TALK ABOUT IDENTIFIER
DICUSSION ABOUT C
PROGRAMMING
• C is a programming language developed at
AT & T Bell Laboratories of USA in 1972,
designed and written by “Dennis Ritchie”.
• C is highly portable i.e., software for one• C is highly portable i.e., software for one
computer can be run on another computer.
• A C program is basically a collection of
functions.
VARIABLES
• A variable is a data name that may be
used to store a data value.
• It may consist of letters, digits and
underscore character.
• It may consist of letters, digits and
underscore character.
Rules for defining
variables
• They must begin with a letter.
• The length should not be normally more
than eight characters.
• Uppercase and lowercase are significant.• Uppercase and lowercase are significant.
• The variable name should not be a
keyword.
Continue..
• Valid Variables Names:
John Value T_raise
Delhi x1 ph_value
mark sum1 distancemark sum1 distance
• Invalid Variable Names:
123 (area)
% 25th
Continue….
#include<stdio.h>
main()
{
int x=6, y=6, sum;
x=6, y=6 – Variable x
and y is variable
name and 6 is its
value.int x=6, y=6, sum;
sum=x+y;
printf(“total=%d);
}
value.
TOKEN
• C tokens are the basic buildings
blocks in C language which are
constructed together to write a C
program.program.
• Each and every smaller individual
units in a C program are known as C
tokens.
Continue…
Types of tokens:
Continue….
• Keywords---- int, while, flost.
• Identifier--- sum, total, avg
• Constant----- 10, 20 (number)• Constant----- 10, 20 (number)
• String-------- “ram”, “hello”
• Special symbols- {}, (), []
• Operators--- +,/, -, *
Continue…
#include<stdio.h>
main()
{
int x=6, y=6, sum;
main, x, y, sum -
Identifier
{},() – Special symbol
int – Keyword
int x=6, y=6, sum;
sum=x+y;
printf(“total=%d);
}
int – Keyword
main, {},(), int, x, y,
sum-- Tokens
IDENTIFIER
• A C identifier refers to name used to
identify a variable, function, structures or
any other user defined item or entity.
• Identifier must be unique. They are• Identifier must be unique. They are
created to give unique name to
item/variable/ name to identify it during
the execution of the program.
Continue….
Rules for writing an identifier:
• The first latter of an identifier should be
either a letter or an underscore.
• A valid identifier can have both uppercase• A valid identifier can have both uppercase
or lowercase letter.
• Can not use keyword as an identifier.
Continue…
#include<stdio.h>
main()
{
int x=6, y=6, sum;
x, y, sum-- Identifier
int x=6, y=6, sum;
sum=x+y;
printf(“total=%d);
}
Conclusion
After this presentation we can say
that without Variable, Token and
Identifier C programming is
impossible because these things areimpossible because these things are
indicates the C compiler to run the
program.
THANK YOU ALL FORTHANK YOU ALL FOR
YOUR VALUABLE TIMEYOUR VALUABLE TIMEYOUR VALUABLE TIMEYOUR VALUABLE TIME

Variable, token, & identifier in c programming

  • 1.
    WELCOME TO TODAYSWELCOMETO TODAYS PRESENTATIONPRESENTATION ONON WELCOME TO TODAYSWELCOME TO TODAYS PRESENTATIONPRESENTATION ONON VARIABLES,TOKENVARIABLES,TOKEN & IDENTIFIER& IDENTIFIERVARIABLES,TOKENVARIABLES,TOKEN & IDENTIFIER& IDENTIFIER BYBY MEHENAZ KHANMEHENAZ KHAN SORNASORNA
  • 2.
    OBJECTIVES • LITTLE DISCUSSIONABOUT C PROGRAMMING • TALK ABOUT VERIABLES • TALK ABOUT TOKEN• TALK ABOUT TOKEN • TALK ABOUT IDENTIFIER
  • 3.
    DICUSSION ABOUT C PROGRAMMING •C is a programming language developed at AT & T Bell Laboratories of USA in 1972, designed and written by “Dennis Ritchie”. • C is highly portable i.e., software for one• C is highly portable i.e., software for one computer can be run on another computer. • A C program is basically a collection of functions.
  • 4.
    VARIABLES • A variableis a data name that may be used to store a data value. • It may consist of letters, digits and underscore character. • It may consist of letters, digits and underscore character.
  • 5.
    Rules for defining variables •They must begin with a letter. • The length should not be normally more than eight characters. • Uppercase and lowercase are significant.• Uppercase and lowercase are significant. • The variable name should not be a keyword.
  • 6.
    Continue.. • Valid VariablesNames: John Value T_raise Delhi x1 ph_value mark sum1 distancemark sum1 distance • Invalid Variable Names: 123 (area) % 25th
  • 7.
    Continue…. #include<stdio.h> main() { int x=6, y=6,sum; x=6, y=6 – Variable x and y is variable name and 6 is its value.int x=6, y=6, sum; sum=x+y; printf(“total=%d); } value.
  • 8.
    TOKEN • C tokensare the basic buildings blocks in C language which are constructed together to write a C program.program. • Each and every smaller individual units in a C program are known as C tokens.
  • 9.
  • 10.
    Continue…. • Keywords---- int,while, flost. • Identifier--- sum, total, avg • Constant----- 10, 20 (number)• Constant----- 10, 20 (number) • String-------- “ram”, “hello” • Special symbols- {}, (), [] • Operators--- +,/, -, *
  • 11.
    Continue… #include<stdio.h> main() { int x=6, y=6,sum; main, x, y, sum - Identifier {},() – Special symbol int – Keyword int x=6, y=6, sum; sum=x+y; printf(“total=%d); } int – Keyword main, {},(), int, x, y, sum-- Tokens
  • 12.
    IDENTIFIER • A Cidentifier refers to name used to identify a variable, function, structures or any other user defined item or entity. • Identifier must be unique. They are• Identifier must be unique. They are created to give unique name to item/variable/ name to identify it during the execution of the program.
  • 13.
    Continue…. Rules for writingan identifier: • The first latter of an identifier should be either a letter or an underscore. • A valid identifier can have both uppercase• A valid identifier can have both uppercase or lowercase letter. • Can not use keyword as an identifier.
  • 14.
    Continue… #include<stdio.h> main() { int x=6, y=6,sum; x, y, sum-- Identifier int x=6, y=6, sum; sum=x+y; printf(“total=%d); }
  • 15.
    Conclusion After this presentationwe can say that without Variable, Token and Identifier C programming is impossible because these things areimpossible because these things are indicates the C compiler to run the program.
  • 16.
    THANK YOU ALLFORTHANK YOU ALL FOR YOUR VALUABLE TIMEYOUR VALUABLE TIMEYOUR VALUABLE TIMEYOUR VALUABLE TIME