All Keywords in C Programming Language


Keywords in C Programming Language

  1. Keywords are those words whose meaning is already defined by Compiler
  1. Cannot be used as Variable Name
  1. There are 32 Keywords in C
  1. C Keywords are also called as Reserved words .

32 C programming Keywords



Example Of Keyword 

  1. #include <stdio.h>
  2. void main() {
  3.       int i = 0;
  4.       const char ch = 'a';
  5.       // value of ch is a.  So, case 'a' will be executed
  6.       switch (ch) {
  7.               case 'a':
  8.                       // prints hello world for 3 times
  9.                       for (i = 0; i < 3; i++)
  10.                               printf("Hello world!!\n");
  11.                       break;
  12.               case 'b':
  13.                       // prints hello world for 4 times
  14.                       do {
  15.                               printf("Hello Friend!!\n");
  16.                               i++;
  17.                       } while (i < 3);
  18.                       break;
  19.  
  20.               default:
  21.                       // prints unknow character
  22.                       printf("Unknown character\n");
  23.                       break;
  24.       }
  25.       return;                                                                                     
  26. }                                                                                                    
                       
OUTPUT:-Hello World
                   Hello World
                   Hello World


Keyword Used in this Program-

void, const, char, int, switch, case, for, while, do, break, default and return are the  keywords used in the above program.




Comments

Popular posts from this blog

Implement Bouncing Ball Animation Using C Graphics

Walking Stickman -Using C graphics

Sine Wave - Using C Graphics