All Keywords in C Programming Language
Keywords in C Programming Language
- Keywords are those words whose meaning is already defined by Compiler
- Cannot be used as Variable Name
- There are 32 Keywords in C
- C Keywords are also called as Reserved words .
Example Of Keyword
- #include <stdio.h>
- void main() {
- int i = 0;
- const char ch = 'a';
- // value of ch is a. So, case 'a' will be executed
- switch (ch) {
- case 'a':
- // prints hello world for 3 times
- for (i = 0; i < 3; i++)
- printf("Hello world!!\n");
- break;
- case 'b':
- // prints hello world for 4 times
- do {
- printf("Hello Friend!!\n");
- i++;
- } while (i < 3);
- break;
- default:
- // prints unknow character
- printf("Unknown character\n");
- break;
- }
- return;
- }
OUTPUT:-Hello World
Hello World
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
Post a Comment