Keywords in c programming language

 ๐Ÿ’ฅ Keywords in C (In Detail)๐Ÿ˜

๐Ÿ”ธ What are Keywords?

  • Keywords are reserved words in C
  • They have predefined meaning
  • Cannot be used as variable names
  • Written only in lowercase

๐Ÿ”ธ Total Keywords in C

  • C has 32 keywords

๐Ÿ”ธ List of Keywords with Explanation

๐Ÿ”น Data Type Keywords

Keyword     Meaning

  • int                Integer data type
  • float            Decimal (floating point) number
  • double        Double precision floating point
  • char            Single character
  • void            No value or empty

๐Ÿ”น Storage Class Keywords

Keyword     Purpose

  • auto              Default storage class
  • register        Store variable in CPU register
  • static            Retains value between function calls
  • extern          Declares global variable

๐Ÿ”น Control Statement Keywords

Keyword     Use

  • if                   Conditional execution
  • else              Alternative condition
  • switch         Multiple condition selection
  • case             Part of switch
  • default        Executes if no case matches

๐Ÿ”น Looping Keywords

Keyword      Use

  • for                 Loop with initialization
  • while            Loop with condition
  • do                  Loop executes at least once
  • break            Exit from loop
  • continue      Skip current iteration

๐Ÿ”น Function & Program Control

Keyword        Meaning

  • return            Return value from function
  • goto                Jump to labeled statement

๐Ÿ”น Type Modifiers

Keyword        Meaning

  • short             Smaller integer
  • long              Larger integer
  • signed          Allows negative values
  • unsigned     Only positive values

๐Ÿ”น User Defined Data Type Keywords

Keyword       Use

  • struct           Structure
  • union           Union
  • enum           Enumeration
  • typedef        Create alias name

๐Ÿ”น Other Important Keywords

Keyword      Meaning

  • sizeof           Size of data type
  • const            Value cannot be changed
  • volatile        Value can change anytime

๐Ÿ”ธ Example Using Keywords

C

int main()

{

    static int a = 10;

    if(a > 5)

        return 0;

}

Comments

Popular posts from this blog

History of c programming language

Evolution of programming languages

How to Create a Bloger account