Keywords are predefined reserved words in the C language that have a special meaning and cannot be used as variable names, function names, or any other identifiers in the program. These keywords are part of the syntax and grammar of the language and are used to define the structure of the program. Here is a list of all the keywords in the C language:
List of the keywords in C language
There are only 32 keywords available in C.
Here is a brief explanation of each keyword:
- auto – Specifies that a variable has automatic storage duration.
- break – Terminates the nearest enclosing loop or switch statement.
- case – Labels a statement within a switch statement.
- char – Specifies a character type.
- const – Specifies that a variable’s value cannot be changed.
- continue – Skips the rest of the loop body and continues with the next iteration.
- default – Specifies the default label in a switch statement.
- do – Starts a do-while loop.
- double – Specifies a double-precision floating-point type.
- else – Specifies an alternative to an if statement.
- enum – Specifies an enumeration type.
- extern – Specifies that a variable or function is defined in another file.
- float – Specifies a single-precision floating-point type.
- for – Starts a for loop.
- goto – Transfers control to another part of the program.
- if – Starts an if statement.
- int – Specifies an integer type.
- long – Specifies a long integer type.
- register – Specifies that a variable is stored in a register.
- return – Returns a value from a function.
- short – Specifies a short integer type.
- signed – Specifies a signed integer type.
- sizeof – Returns the size of a type or variable.
- static – Specifies that a variable or function has static storage duration.
- struct – Specifies a structure type.
- switch – Starts a switch statement.
- typedef – Specifies a type alias.
- union – Specifies a union type.
- unsigned – Specifies an unsigned integer type.
- void – Specifies a type with no value.
- volatile – Specifies that a variable may be changed by external factors.
- while – Starts a while loop.
In conclusion, these keywords are an essential part of the C programming language, and their correct usage is necessary to create well-formed and meaningful C programs.