In this tutorial, we will study what keywords in c programming are. So let us start.
Keywords are the predefined tokens in the C language. They can also be seen as reserved words. There are 32 types of keywords and every keyword is unique. These keywords are used for performing some particular task which is defined. There are many keywords like the if, else, switch, etc which are used for decision control programming structure. The keywords like int, float, character, etc are used for telling the data type of the variable during their declaration.
auto | break | case | char |
const | continue | default | do |
double | else | enum | extern |
float | for | goto | if |
int | long | register | return |
short | signed | sizeof | static |
struct | switch | typedef | union |
unsigned | void | volatile | while |
The auto keyword declares automatic variables.
The break statement terminates the innermost loop immediately when it's encountered. It's also used to terminate the switch statement.
The continue statement skips the statements after it inside the loop for the iteration.
The switch and case statement is used when many statements have to be executed among many blocks.
The char keyword declares a character variable. For example:
An identifier can be declared as constant by using the const keyword.
In the do while first the code is executed and then the condition is checked.
Both the keywords double and float are used for the declaration of floating type variables.
if and else are used for making the decisions.
Enumeration types are declared in C programming by using the keyword enum.
The extern keyword is used to declare that a variable or a function has an external linkage outside of the file it is declared.
There are three types of loops in C programming language. The for loop is written in the C programming language using the keyword.
The goto statement is used to transfer control of the program to the specified label.
The keyword int declares the integer type variables.
The short, long, signed, and unsigned are type modifiers. They are used for altering the meaning of a base data type to yield a new type.
The return keyword is used to terminate the function and return the value.
The sizeof keyword is used to evaluate the size of data (a variable or a constant).
The register keyword is used to create register variables which are much faster than normal variables.
The static keyword creates a static variable. The value of the static variables persists until the end of the program.
The struct keyword declares a structure. A structure can be used to hold the variables of different types under a single name.
The typedef keyword explicitly associates a type with an identifier.
A union is used for grouping different types of variables under a single name.
The void keyword meaning nothing or no value.
The volatile keyword creates volatile objects. A volatile object can be modified in an unspecified way by the hardware.