Skip to main content

C Tokens

    C TOKENS


The compiler breaks a program into the smallest possible units and proceeds to the various stages of the compilation,which is called Token.lexical analyzer that perform tokenzation process.
   
  Types of C Tokens




💥  Keyword 

Keyword are reserved word. In C language which has pre-defined meaning and syntax.C language has a 32 keywords.Keyword are must be written in a lower case letter.It is a combination of alphabetical character.

Keywords are as follows:-



 💥 Identifiers  

👉🏻Identifier is a user-defined word.
👉🏻Identifier refers to name of variable,function,array,structure,etc.
👉🏻Every identifier must start with upper and lower case letter.
👉🏻In identifier special symbols are not allowed.
👉🏻Every identifier must start with an alphabet with underscore.
👉🏻Identifier can only contain letter and digit.but it not start with alphanumerical.
👉🏻Only 31 character size is valid for identifier.
👉🏻Identifier must not contain white space in it.
👉🏻Identifier contain the alphanumeric character but must start with alphabetical character and underscore.  

 💥 Constants   
  
C Constants refer to fixed values that do not change value during execution of program. there value cannot be modified after their definition.And this fixed value also called Literals. Constants is define the const keyword.C support various type of constant.

Constants definition of C
 const datatype constants_name



1.Numeric Constants:-It constants of all constants which deals with numbers.It have a two types.

  • Integer Constants :- A integer constants refer to sequence of digit and it is of 4 types.                                                              1. Binary Integer Constants: It consist of (0-1) ether 0,1 digit.      2.Octal Integer Constants: It consist of 8 (0-7) digit.   3.Decimal Integer Constants: It consist of 10 (0-9) digit.             4.Hexadecimal Integer Constants: It consist of 16 (0-15) digit.                 
  • Real Constants:- A real constants has an integer part, decimal point, Fractional part, exponent part. The numbers containing fractional parts like 89.99 are  called real or floating points constant.                                                                                                                                                                                              2.Character Constants:- Character Constants having single character only .this constants are enclosed in a single quotes.Example;- 'A','t'.This constants have a two types
  • String Constants:- String Constants containing sequence of character .This constants are enclosed in a double quotes.And they may include letter,digit. special character. Example:- "Hai","999".
  • Backslash Constants:- C support some special constants which are used in output function.every backslash constants represents specific output on screen .Example:-                                                                                                                                                                   '\n' = new line                                                                               '\t' = tab                                                                                         '\0' = null                                                                                       '\?' = to show question mark on screen.                                                                                                                                                                                              💥  Special Symbols                                                                                                                                                                In C language used  special symbols and they have special  meaning. 
➤Square Brackets[]:-The opening and closing brackets represent the single and multidimensional subscripts.

➤Simple Brackets():-It is used in function declaration and function calling. For example, printf() is a pre-defined function.

➤ Curly Braces{}:-It is used in the opening and closing of the code. It is used in the opening and closing of the loops.

➤Comma(,):-It is used for separating for more than one statement and for example, separating function parameters in a function call, separating the variable when printing the value of more than one variable using a single printf statement.

➤Hash/Pre-Processor:- It used for pre-processor directive. It basically denotes that we are using the header file.

➤ Asterisk(*):-This symbol is used to represent pointers and also used as an operator for multiplication.

➤Tilde(~):-  It is used as a destructor to free memory.
 Period(.):-It is used to access a member of a structure or a union.   
 
 💥  Operators 

 C operator are symbols that are used to perform mathematical and logical operations. In C language different types of operators are as follows:-


👉🏻Arithmetic Operators:- This operator are used to perform mathematical calculation like 
Operator     Description
   +               Addition
   -                Subtraction
   *               Multiplication
   /                Division
  %               Modulus
Example A=10, B=40     A+B=50

👉🏻Logical Operators:- This operator are used for check the condition either true or false. In C language provide 3 types of logical operator this operator are
Operator        Description
&&                 AND
  ||                    OR
  !                     NOT

👉🏻Relational Operator:- This operator are used to comparing two values. 
Operator       Description
  >                  greater than 
  <                  less than
  = =               is equal to
  =!                 is not equal to
  >=                greater than equal to
 <=                 less than equal to

👉🏻Conditional Operator:-This operator are used to construct conditional expression. conditional operator is also called ternary operator. 
?:   Conditional expression
Example if condition is true then value X otherwise value Y.

👉🏻Bitwise Operator:- Bitwise operator is a special operator in c that used for bit operation two variable.
Operator        Description
 >>                 Binary Right Shift Operator
 <<                 Binary Left Shift Operator
 ~                   Binary Ones Complement Operator
 &                  Binary AND Operator
 |                    Binary OR Operator
 ^                   Binary XOR Operator

👉🏻Assignment Operator:-Assignment operator are used to assign the value to the operand.
Operator            Description
    =                     Assign Value
 <<=                    Left shift and assign
 >>=                    Right shift and assign
 +=                     Increment then assign
  -=                     Decrement then assign
 &=                    Bitwise AND assign

 👉🏻Increment And Decrement Operator:- In C language Increment operator are used to increase the value of the variable by one and Decrement operator are used to decrease the value of the variable by one.
Operator          Description
 ++                    Increment
 --                      Decrement 
 👉🏻Special Operator:-Special operator is also knows as Misc. Operator.
Operator        Description
  *                   Pointer to a variable 
 sizeof()          Return the size of memory location
  &                  Return the address of memory location
            

                NEXT TOPIC AVAILABLE SOON AS....

Comments

  1. Beautiful content enough to know.
    To make it searchable on google search listing...follow the below link.

    https://www.any1cando.online/2020/04/how-i-can-index-blogger-web-page.html

    Author : K Kashyap

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete

Post a Comment

Popular posts from this blog

Let's Be Technical

.   Programming Languages And There       Importance       Before you know about programming  language  we  must  know about languages. the language is a communication medium why which we can understand other person the language way of the transformation of various ideas and thoughts among people. After this  now we  know about programming language a programming language is a formal language, which comprises a set of instructions that produce various kinds of output. Programming languages are used in computer programming to implement algorithms. Most programming languages consist of instructions for computers. How its Importance of Programming Language Important in your daily life we use various device & tools that are works one the programming language like microwave ,ATM, Lift etc.  Programming language is important  because it define semantics and grammar which allow the programmers to effectively b  communicate with the machine that they program. A programming

Rapid View Of Technology

  Currently Running Top 10 Programming Languages C programming language                         C language is the most popular and and widely used programming language.The C language is developed in 1972 by  Dennis Ritchie at bell laboratories of AT&T American Telephone & Telegraph, located in the U.S.A . C language is also knows as mother and structured programming language.C language is a basic language of all other languages. C++ programming language                                 C++ is object oriented programming language. C++ programming language was developed in 1980 by Bjarne Stroustrup  at bell laboratories of AT&T,located in U.S.A  . C++ is totally based on oops concept. HTML                                                                                                                        Hyper Text Markup Language. html is a markup language it is not a programming language.   But it help full in programming language. html is a used to create web page

C Looping Statements

Looping/Iterative Statements What is Loop one statements are executed one or more time .looping simplify the complex problems into the easy one.loop provides code reusability.  we do not need to write same code again and again.looping is used to traverse the element of  data structure. Types of loops 💥 For Loop:- In C the For loop is used to iterate a part of the program many time.In the for loop number of iteration is fixed. Syntax:- for(initialization,condition,increment/decrement) { statement }                                   Flow chart of for loop Example                                                                      #include<stdio.h>    #include<conio.h>                                              void main()                            { int i=0; for(i=1;i<=10;i++) { printf("%d",i); } getch(); } Output 1 2 3 4 5 6 7 8 9 10 💥 While loop:-While loop is also known as entry control loop Because  it first check t