Monday 29 March 2021

WHAT ARE IDENTIFIER IN C

 What are Identifiers:

Identifiers are names that are given to Variable, Arrays, Functions, Structures etc.

For example-int pen; Here, Pen is an identifier.

An identifier must be unique because the compiler needs to identify it during the execution of a program. And identifiers must be different from keywords, that is, Keyword and Identifiers cannot have the same name.


The identifiers are depicted in c language as follow:

1. Basic the Letter,Number,symbol of c                     language

2. Identifiers

3. Instruction


1. Basic the Letter,Number,Symbol of c language:

  * A to Z

  * a to z

  * 0 to 9

  * (,{,:,"/,\,?,<,>,+,=,*,&,%,!


2. Identifiers:

   (I). Constant

   (II). Variable

   (III). Keyword



(I). Constant:

                   A constant is a data item that will not be changed during execution of a single program. The constan in C language is as follows.


                              


                         *➡️ Integer constant

 Constant ➡️  *➡️ Float point constant

                         *➡️ Character constant

                         *➡️ String constant


* Integer constant:

                      An integer constant without any decimal point is a whole number.


* Float point constant:

                          Numerical values ​​(fractional) numerical values ​​are called floating point constant, where we can also use + and - negative number and positive number. That is the octal number.


 * Character constant:

                        The R character is included in a pair of [''] (single code), which is called character. Each character is associated with a unique value called [ASCII] valuse.


* String constant:

                A sequential character of the character with [""] (Double code) string always ending with zero (Null) (\ °).


(II). Variable:

         Variable is an identifier that represents the address of the memory location.

Identifier:

               A unique name given to a particular block / which is used in C


             * 8 bits - 1 byte


             * 1024 bytes - 1KB


             * 1024KB - 1MB


             * 1024MB - 1GB


             * 1024GB - 1TB




(III). Keyword:

          Keyword C are pre-defined reserved words used in programming.


    ➡️ Compiler known words

    ➡️ Keywords are part of syntax and cannot be used as 'identifier'.

For example: int, float, char, for, if, while, include, auto, break, register, etc.

 ๐ŸšฆRule:

  * Keyword not allowed.

  * Alphabets and numbers allowed.

  * Allowed except special character '_' (underscore).

  * It should not start with number.

  * White blanks or spaces are not allowed.


Difference between keywords and identifiers

Identifier & Keyword

 3. Instruction:

  1. Data type declaration instruction

  2. Input/Output instruction

  3. Airthmetic instruction

  4. Control instruction


Kinds of identifiers:

C languege defines two types of identifiers.

1. Internal

2. External


1. Internal identifier:

                      If the identifier is used in the external link process, it is called external. These identifiers are also known as external names; Functio name and Global variable are names that are shared between the source file, s. It contains 63 important characters.


2. External identifier:

                      If the identifier is not used in the external link process, it is called internal. These identifiers are also known as internal names; Local variable names are included. It contains at least 31 important characters.


Hindi translation। เคนिเคจ्เคฆी เค…เคจुเคตाเคฆ ๐Ÿ‘‡๐Ÿ‘‡


What are Identifiers:


Identifiers เคตे เคจाเคฎ เคนैं เคœो Variable, Arrays, Functions, Structures เค†เคฆि เค•ो เคฆिเค เคœाเคคे เคนैं।

เค‰เคฆाเคนเคฐเคฃ เค•े เคฒिเค- int pen; เคฏเคนां, Pen เคเค• Identifier เคนै!

เคเค• Identifier เค…เคฆ्เคตिเคคीเคฏ(unique) เคนोเคจा เคšाเคนिเค เค•्เคฏोंเค•ि เค•ंเคชाเค‡เคฒเคฐ เค•ो เคเค• เค•ाเคฐ्เคฏเค•्เคฐเคฎ(program)เค•े เคจिเคท्เคชाเคฆเคจ เค•े เคฆौเคฐाเคจ(during) เค‡เคธเค•ो identify เค•เคฐเคจे เค•ी เค†เคตเคถ्เคฏเค•เคคा เคนोเคคी เคนै। เค”เคฐ identifiers keywords เคธे เคญिเคจ्เคจ เคนोเคจा เคšाเคนिเค, เค…เคฐ्เคฅाเคค् Keyword เค”เคฐ Identifiers เค•ा เคเค• เคนी เคจाเคฎ เคจเคนीं เคนो เคธเค•เคคा เคนै।


The identifiers are depicted in C language as follow:

1. Basic the Letter,Number,symbol of c                    language

2. Identifiers

3. Instruction


1. Basic the Letter,Number,Symbol of c language

   * A to Z

   * a to z

   * 0 to 9

   * (,{,:,"/,\,?,<,>,+,=,*,&,%,!


2. Identifiers

   (I). Constant

   (II). Variable

   (III). Keyword


 (I). Constant:

                  เคเค• constant เคเค• data item เคนै, เคœिเคธे เค•िเคธी เคเค• program เค•े เคจिเคท्เคชाเคฆเคจ(execution) เค•े เคฆौเคฐाเคจ เคจเคนीं เคฌเคฆเคฒा เคœाเคเค—ा. C language เคฎें constan เค‡เคธ เคช्เคฐเค•ाเคฐ เคนै।

                             

                     *➡️ Integer constant

Constant➡️*➡️ Float point constant

                     *➡️ Character constant

                     *➡️ String constant

* Integer constant:

                         เคฌिเคจा เค•ोเคˆ decimal point เค•े เคเค• integer constant เคเค• whole number เคนै,


* Float point constant:

                         เค…ंเคถों(fractional) เคตाเคฒे เคธंเค–्เคฏाเคค्เคฎเค• เคฎाเคจों(newmeric value) เค•ो floating point constant เค•เคนा เคœाเคคा เคนै เคตเคนाँ เคนเคฎ + เค”เคฐ - negative number เค”เคฐ positive number เค•ा เคญी เค‰เคชเคฏोเค— เค•เคฐ เคธเค•เคคे เคนैं। เคตเคน octal number เคนै।


* Character constant:

                          R เค…เค•्เคทเคฐ(character) เค•ो [' '](single code) เค•ी เคœोเคก़ी เคฎें เคถाเคฎिเคฒ เค•िเคฏा เคœाเคคा เคนै, เคœिเคธे character เค•เคนा เคœाเคคा เคนै เคช्เคฐเคค्เคฏेเค• character unique value เค•े เคธाเคฅ เคœुเคก़ा เคนुเค† เคนै เคœिเคธे [ASCII] valuse เค•เคนเคคे เคนै


* String constant:

                         [""] ( Double code) string เค•े เคธाเคฅ character เค•ा เคเค• เค•्เคฐเคฎिเค• เค•्เคฐเคฎ(sequential) เคนเคฎेเคถा เคถूเคจ्เคฏ(Null) เคธे (\ °) เคธเคฎाเคช्เคค เคนोเคคा เคนै

                         

(II). Variable:

              Variable เคเค• Identifier เคนोเคคा เคนै, เคœो memory location เค•े address เค•ो เคช्เคฐเคคिเคจिเคงिเคค्เคต (represent) เค•เคฐเคคा เคนै!

Identifier:

           เคเค• particular block เค•ो เคฆिเคฏा เค—เคฏा เค…เคจोเค–ा เคจाเคฎ / เคœिเคธเค•ा เค‰เคชเคฏोเค— C เคฎें เค•िเคฏा เคœाเคคा เคนै

            * 8 bits - 1 byte

            * 1024 bytes - 1KB

            * 1024KB - 1MB

            * 1024MB - 1GB

            * 1024GB - 1TB

               

(III). Keyword:

           Keyword C programming เคฎें เค‰เคชเคฏोเค— เค•िเค เค—เค เคชूเคฐ्เคต-เคจिเคฐ्เคงाเคฐिเคค เค†เคฐเค•्เคทिเคค เคถเคฌ्เคฆ เคนैं!

   ➡️ Compiler known words

   ➡️ Keyword syntax เค•ा เคนिเคธ्เคธा เคนैं เค”เคฐ เค‰เคจ्เคนें 'identifier' เคฐूเคช เคฎें เค‰เคชเคฏोเค— เคจเคนीं เค•िเคฏा เคœा เคธเค•เคคा เคนै!


เค‰เคฆाเคนเคฐเคฃ เค•े เคฒिเค: int, float, char, for, if, while, include, auto, break, register, เค†เคฆि

๐ŸšฆRule:

  * Keyword เค•ी เค…เคจुเคฎเคคि เคจเคนी เคนै

  * Alphabets เค”เคฐ numbers เค•ी เค…เคจुเคฎเคคि เคนै

  * Special character เค•ो เค›ोเคก़เค•เคฐ เค…เคจुเคฎเคคि เคนै ’_’ (underscore)

  * เคฏเคน number เคธे เคถुเคฐू เคจเคนीं เคนोเคจा เคšाเคนिเค

  * White blanks เคฏा spaces เค•ी เค…เคจुเคฎเคคि เคจเคนीं เคนै

Keyword & Identifier



3. Instruction:
   1. Data type declaration instruction
  2. Input/Output instruction
  3. Airthmetic instruction
  4. Control instruction

      
       
        Kinds of identifiers:
C languege เคฆो เคช्เคฐเค•ाเคฐ เค•े identifiers เค•ो เคชเคฐिเคญाเคทिเคค เค•เคฐเคคा เคนै।
1. Internal
2. External

     
1. Internal identifier:
                                     เคฏเคฆि identifier เค•ा เค‰เคชเคฏोเค— external link process เคฎें เค•िเคฏा เคœाเคคा เคนै, เคคो เค‰เคธे external เค•เคนा เคœाเคคा เคนै। เค‡เคจ identifiers เค•ो external names เค•े เคฐूเคช เคฎें เคญी เคœाเคจा เคœाเคคा เคนै; Functio name เค”เคฐ Global variable เคจाเคฎ เคถाเคฎिเคฒ เคนैं เคœो source file,s เค•े เคฌीเคš เคธाเคा เค•िเค เคœाเคคे เคนैं। เค‡เคธเคฎें เค•ाเคฎ เคธे เค•ाเคฎ 63 เคฎเคนเคค्เคตเคชूเคฐ्เคฃ เค…เค•्เคทเคฐ เคนै।

2. External identifier:
                                     เคฏเคฆि external link process เคฎें identifier เค•ा เค‰เคชเคฏोเค— เคจเคนीं เค•िเคฏा เคœाเคคा เคนै, เคคो เค‡เคธे internal เค•เคนा เคœाเคคा เคนै। เค‡เคจ identifiers เค•ो internal names เค•े เคฐूเคช เคฎें เคญी เคœाเคจा เคœाเคคा เคนै; local variable เค•े เคจाเคฎ เคถाเคฎिเคฒ เคนैं। เค‡เคธเคฎें เค•เคฎ เคธे เค•เคฎ 31 เคฎเคนเคค्เคตเคชूเคฐ्เคฃ เคตเคฐ्เคฃ เคนैं।


BASIC C PROGRAMMING

 Introduction to c language:

C เคเค• programming language เคนै. C language เค•ो "เคกेเคจिเคธ เคฐिเคšเคฐ्เคก " เคจे เคธเคจ् 1972 เคฎें เคตिเค•เคธिเคค เค•िเคฏा เคฅा।
  เคฏเคน language เคเค• เคŠंเคšे เคธ्เคคเคฐ (High level) เค•ी programming language เคนै, เคœो เคธ्เคฐोเคค เค•ोเคก (source code)เค•ो เคฎเคถीเคจ เค•ोเคก (machine code) เคฎें เค…เคจुเคตाเคฆ เค•เคฐเคจे เค•े เคฒिเค เค•ंเคชाเค‡เคฒเคฐ เค•ा เค‰เคชเคฏोเค— เค•เคฐเคคा เคนै।
c เคช्เคฐोเค—्เคฐाเคฎिंเค— เคฒैंเค—्เคตेเคœ เคซीเคšเคฐ्เคธ เค•ो เคชเคนเคฒे เค•ी เคญाเคทा เคฎें basic combined programming language เค•เคนा เคœाเคคा เคนै!

Dennis Ritchie

Variable:

Variable memory location เค•ो เคฆिเคฏा เค—เคฏा เคเค• เคจाเคฎ เคนै, เค‰เคธ memory location เคชเคฐ เคœिเคธ เคชเคฐ เคนเคฎ single value store เค•เคฐ เคธเค•เคคे เคนै।
      

 Declaration of variable:
    Data type                variable-name

1.     Int                           a, x, y, z;
2.   Float                        b,r;
3.   Char                         c;
       
 Data type:
เคฏเคน เคญी เคเค• เคกाเคŸा (data) เค•ी เคคเคฐเคน เคนोเคคा เคนै,เคœिเคธเค•ो เคช्เคฐोเค—्เคฐाเคฎ(program) เค•े เค…เคจ्เคฆเคฐ เคช्เคฐเคฏोเค— (use) kiya เคœाเคคा เคนै।
C language เคฎें เค•เคˆ เคชूเคฐ्เคตเคจिเคฐ्เคงाเคฐिเคค (predefine) เคกाเคŸा เคŸाเค‡เคช (data type) เค‡เคธ เคช्เคฐเค•ाเคฐ เคนै,
Int, Float, Char  เค†เคฆि।

     Basic Data Type              Derived Data
                                                                     Type

1.    Integer type(int)                 Pointer
2.   Floating type(float)            Array
3.    Character type(char)        Structure-
                                                            -Union


Data type is depicted as follows:

  เคฎूเคฒ เคกेเคŸा เคช्เคฐเค•ाเคฐ เคนैं-

 (1) Integer data type(เคชूเคฐ्เคฃांเค• เคกेเคŸा เคช्เคฐเค•ाเคฐ)

 (ii) Character data type(เคšเคฐिเคค्เคฐ เคกेเคŸा เคช्เคฐเค•ाเคฐ)

(iii) Floating data type(เคซ़्เคฒोเคŸिंเค— เคกेเคŸा เคช्เคฐเค•ाเคฐ)


 1. เคชूเคฐ्เคฃांเค• เคกाเคŸा เคช्เคฐเค•ाเคฐ (int)- เคชूเคฐ्เคฃांเค• เคตे เคธंเค–्เคฏाเคँ เคนोเคคी เคนैं เคœिเคจเค•े เคฏा เคคो เค‹เคฃाเคค्เคฎเค• เคฏा เคงเคจाเคค्เคฎเค• เคฎाเคจ เคนो เคธเค•เคคे เคนैं เคฒेเค•िเคจ เค‰เคจเคฎें เคฎाเคจ เคจเคนीं เคนो เคธเค•เคคे เคนैं เคฆเคถเคฎเคฒเคต। เคชूเคฐ्เคฃांเค• เคช्เคฐเค•ाเคฐ เค•े เคฎाเคจों เค•े เคฒिเค เคนเคฎ (int) เค•ीเคตเคฐ्เคก เค•ा เค‰เคชเคฏोเค— เค•เคฐเคคे เคนैं।  

เค‰เคฆाเคนเคฐเคฃ เค•े เคฒिเค- int pen;  เคฏเคนां, เค•เคฒเคฎ pen เคเค• variableเคนै เคœो integer typeเค•े values เค•ो store เค•เคฐ เคธเค•เคคा เคนै। userเคฆ्เคตाเคฐा เค†เคตเคถ्เคฏเค•เคคाเคจुเคธाเคฐ เคเค• เคช्เคฐोเค—्เคฐाเคฎ เคฎें integer type เค•े variable เคนो เคธเค•เคคे เคนैं

เค‰เคฆाเคนเคฐเคฃ เค•े เคฒिเค- int pen, car, man;  

เคฏเคนां, (pen, car, man) เคธเคญी integer type เค•े value เค•ो store เค•เคฐ เคธเค•เคคे เคนैं।  

Integer type variable เค•ा เค†เค•ाเคฐ เคฏा เคคो 2 bytes (เคชुเคฐाเคจे เคชीเคธी เค•े เคฒिเค) เคฏा 4 bytes (เคจเค เคชीเคธी เค•े เคฒिเค) เคนै।


  2. เคšเคฐिเคค्เคฐ เคกाเคŸा เคช्เคฐเค•ाเคฐ (char) - character 'char' keywork เค•ा เค‰เคชเคฏोเค— เค•เคฐเค•े เค˜ोเคทिเคค(declare) เค•िเค เคœाเคคे เคนैं।

เค‰เคฆाเคนเคฐเคฃ เค•े เคฒिเค- char pen= 'A';

 เคฏเคนां, pen เคเค• เค•ैเคฐेเค•्เคŸเคฐ เคตैเคฐिเคเคฌเคฒ(character variable)เคนै เคœिเคธเคฎें 'a' value เคนै।

Character variable เค•ा เค†เค•ाเคฐ 1 byte เคนै। 



3. เคซ्เคฒोเคŸिंเค— เคกाเคŸा เคช्เคฐเค•ाเคฐ (float) - "float'เคตเคน keyword เคนै เคœिเคธเค•ा เค‰เคชเคฏोเค— เคฆเคถเคฎเคฒเคต เค•े เคธाเคฅ เคธंเค–्เคฏाเค“ं เค•े เคฎूเคฒ्เคฏों เค•ो เคธंเค—्เคฐเคนीเคค(store) เค•เคฐเคจे เค•े เคฒिเค เค•िเคฏा เคœाเคคा เคนै 

เคœैเคธे: 1.3, 5.66, -8.4। 

เค‰เคฆाเคนเคฐเคฃ เค•े เคฒिเค- float boy= 2.4;

เคฏเคนां, เคฒเคก़เค•ा เคเค• variable เคนै เค‡เคธเคฎें เคเค• floating value 2.4 เคนै। 

'double' เค•ा เค‡เคธ्เคคेเคฎाเคฒ 'float' เค•े เคธ्เคฅाเคจ เคชเคฐ เคญी เค•िเคฏा เคœा เคธเค•เคคा เคนै। 'double' 'เคซ्เคฒोเคŸ' เค•ी เคคुเคฒเคจा เคฎें 2 เค—ुเคจा เค…เคงिเค• เคธเคŸीเค•เคคा เคช्เคฐเคฆाเคจ เค•เคฐเคคा เคนै। Keyword 'float' เค•ा เค†เค•ाเคฐ 4 bytes เคนै, เคœเคฌเค•ि 'double' เคนै। 8bytes.

เค‰เคฆाเคนเคฐเคฃ เค•े เคฒिเค- double boy = 2.4; 

C programming เคฎें เคเค• เค˜ाเคคीเคฏ เคธंเค–्เคฏा(exponential number เค•ा เคช्เคฐเคคिเคจिเคงिเคค्เคต(represent) เค•เคฐเคจे เค•े เคฒिเค, เคนเคฎ เค‰เคชเคฏोเค— เค•เคฐ เคธเค•เคคे เคนैं- 

เค‰เคฆाเคนเคฐเคฃ เค•े เคฒिเค, float boy = 5.2 x 10e34;


ENGLISH TRANSLATION:


Introduction to c language:

C is a programming language. C language was developed by "Dennis Richard" in 1972.


   This language is a high level programming language, which uses the compiler to translate source code into machine code.


 c Programming language features are called basic combined programming language in earlier language.

Dennis Ritchie


Variable:

 Variable memory location is a name given to the memory location on which we can store a single value.


Declaration of variable:

Data type                               Variable-Name

 1. Int                                      a, x, y, z;

 2. Float                                  b, r;

 3. Char                                  c;


Data type:

 It is also like a data, which is used in the   program.Many predefine data types in C language are as follows,

  Int, Float, Char etc. 


Basic data type                         Drived data type 

1.Integer type(int)                   Pointer

2.Floating type(float)              Array

3.character type(char)            Structure union                                                            

The data type is depicted as follows:

The basic data types are-

(1) Integer data type (integer data type)

(ii) Character data type

(iii) Floating data type


  1. Integer Data Type (int) - Integers are numbers that can have either negative or positive values ​​but cannot contain values ​​in decimal. For the values ​​of integer type we use the (int) keyword.

For example-int pen;

Here, pen pen is a variable that can store values ​​of integer type.

A program can have integer type variables as required by the user.

For example- int pen, car, man;

Here, (pen, car, man) can store the value of all integer types.

The size of the integer type variable is either 2 bytes (for old PCs) or 4 bytes (for new PCs).



 2. Character data type (char) - character is declared using 'char' keywork.

For example- char pen = 'A';

 Here, pen is a character variable with 'a' value.

The size of the character variable is 1 byte.



3. Floating data type (float) - "float 'is the keyword used to store the values ​​of numbers with decimals.

Such as: 1.3, 5.66, -8.4.

For example- float boy = 2.4;

Here, the boy is a variable with a floating value of 2.4.

 'double' can also be used in place of 'float'. 'double' provides 2 times more accuracy than 'float'. The keyword 'float' is 4 bytes in size, while 'double' is. 8bytes.

For example- double boy = 2.4;

To represent an exponential number in C programming, we can use-

For example, float boy = 5.2 x 10e34;   

OPERATOR IN C

  Operators : An operator is the symbol that specify the operation or activity to be perform. Example :                  C language is ve...