Keywords in C Programming
Tags: cprogramming, programming, tutorial, beginners
Published: 2021-02-14 06:15:08

<p>In this tutorial, we will study what <a href="https://usemynotes.com/keywords-in-c-programming/">keywords in c programming</a> are. So let us start.</p>
<h2>What are the keywords in c programming?</h2>
<p>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.</p>
<h2>List of keywords in c programming</h2><table>
    <tr>
      <td>auto</td>
      <td>break</td>
      <td>case</td>
      <td>char</td>
    </tr>
    <tr>
      <td>const</td>
      <td>continue</td>
      <td>default</td>
      <td>do</td>
    </tr>
    <tr>
      <td>  double</td>
      <td>else</td>
      <td>enum</td>
      <td>extern</td>
    </tr>
    <tr>
      <td>float</td>
      <td>for</td>
      <td>goto</td>
      <td>if</td>
    </tr>
    <tr>
      <td>int</td>
      <td>long</td>
      <td>register</td>
      <td>return</td>
    </tr>
    <tr>
      <td>short</td>
      <td>signed</td>
      <td>sizeof</td>
      <td>static</td>
    </tr>
    <tr>
      <td>struct</td>
      <td>switch</td>
      <td>typedef</td>
      <td>union</td>
    </tr>
    <tr>
      <td>unsigned</td>
      <td>void</td>
      <td>volatile</td>
      <td>while</td>
    </tr>
</table>
<h2>What is the description of each keyword?</h2>
<h3>auto</h3><p>The auto keyword declares automatic variables.</p>
<h3>break and continue</h3>
<p>The break statement terminates the innermost loop immediately when it's encountered. It's also used to terminate the switch statement.<br>The continue statement skips the statements after it inside the loop for the iteration.</p>
<h3>switch, case, and default</h3>
<p>The switch and case statement is used when many statements have to be executed among many blocks.</p>
<h3>char</h3><p>The char keyword declares a character variable. For example:</p>
<h3>const</h3><p>An identifier can be declared as constant by using the const keyword.</p>
<h3>Do while</h3><p>In the do while first the code is executed and then the condition is checked.</p>
<h3>double and float</h3><p>Both the keywords double and float are used for the declaration of floating type variables.</p>
<h3>if and else</h3><p>if and else are used for making the decisions.</p>
<h3>enum</h3><p>Enumeration types are declared in C programming by using the keyword enum.</p>
<h3>extern</h3><p>The extern keyword is used to declare that a variable or a function has an external linkage outside of the file it is declared.</p>
<h3>for</h3><p>There are three types of loops in C programming language. The for loop is written in the C programming language using the keyword.</p>
<h3>goto</h3>
<p>The goto statement is used to transfer control of the program to the specified label.</p>
<h3>int</h3><p>The keyword int declares the integer type variables.</p>
<h3>short, long, signed and unsigned</h3><p>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.</p>
<h3>return</h3><p>The return keyword is used to terminate the function and return the value.</p>
<h3>sizeof</h3><p>The sizeof keyword is used to evaluate the size of data (a variable or a constant).</p>
<h3>register</h3><p>The register keyword is used to create register variables which are much faster than normal variables.</p>
<h3>static</h3><p>The static keyword creates a static variable. The value of the static variables persists until the end of the program.</p>
<h3>struct</h3><p>The struct keyword declares a structure. A structure can be used to hold the variables of different types under a single name.</p>
<h3>typedef</h3><p>The typedef keyword explicitly associates a type with an identifier.</p>
<h3>union</h3><p>A union is used for grouping different types of variables under a single name.</p>
<h3>void</h3><p>The void keyword meaning nothing or no value.</p>
<h3>volatile</h3><p>The volatile keyword creates volatile objects. A volatile object can be modified in an unspecified way by the hardware.</p>