Keywords in C Language – Definition, List and Examples
A keyword is a reserved word in a programming language that has a predefined meaning and specific purpose. In C language, keywords are also known as reserved words because they cannot be used as user-defined names such as variable names, function names or array names. Each keyword has a specific meaning and is used to perform a particular task in a C program. C language is case-sensitive, so keywords are written in lowercase letters. For example, int is a keyword, whereas Int and INT are not keywords.
Keyword किसी Programming Language का एक Reserved Word होता है जिसका पहले से निर्धारित अर्थ एवं विशेष उद्देश्य होता है। C Language में Keywords को Reserved Words भी कहा जाता है क्योंकि इनका उपयोग Programmer द्वारा Variable Name, Function Name या Array Name के रूप में नहीं किया जा सकता है। प्रत्येक Keyword का एक निश्चित अर्थ होता है तथा इसका उपयोग C Program में किसी विशेष कार्य को करने के लिए किया जाता है। C Language Case-Sensitive होती है, इसलिए Keywords को छोटे अक्षरों में लिखा जाता है। उदाहरण के लिए int एक Keyword है, जबकि Int और INT Keywords नहीं हैं।
List of 32 Keywords in C Language (C89/C90)
The original ANSI C (C89/C90) standard defines 32 keywords. These keywords are as follows:
Original ANSI C (C89/C90) Standard में कुल 32 Keywords निर्धारित किए गए हैं। ये Keywords निम्नलिखित हैं:
| No. | Keyword | No. | Keyword |
|---|---|---|---|
| 1 | auto | 17 | int |
| 2 | break | 18 | long |
| 3 | case | 19 | register |
| 4 | char | 20 | return |
| 5 | const | 21 | short |
| 6 | continue | 22 | signed |
| 7 | default | 23 | sizeof |
| 8 | do | 24 | static |
| 9 | double | 25 | struct |
| 10 | else | 26 | switch |
| 11 | enum | 27 | typedef |
| 12 | extern | 28 | union |
| 13 | float | 29 | unsigned |
| 14 | for | 30 | void |
| 15 | goto | 31 | volatile |
| 16 | if | 32 | while |
Additional 5 Keywords in C99
The C99 standard introduced five additional keywords, increasing the total number of keywords to 37.
C99 Standard में पाँच अतिरिक्त Keywords शामिल किए गए, जिससे कुल Keywords की संख्या 37 हो गई।
The additional keywords are:
अतिरिक्त Keywords निम्नलिखित हैं:
inlinerestrict_Bool_Complex_Imaginary
The above list of 37 keywords refers to C99. Later C standards introduced additional keywords and language features.
ऊपर दी गई 37 Keywords की सूची C99 Standard के अनुसार है। बाद के C Standards में और भी Keywords तथा Language Features शामिल किए गए हैं।
Uses of Important C Keywords
Some important keywords and their uses are explained below:
कुछ महत्वपूर्ण Keywords तथा उनके उपयोग निम्नलिखित हैं:
| Keyword | Purpose |
|---|---|
int | Declares an integer variable. |
char | Declares a character variable. |
float | Declares a floating-point variable. |
double | Declares a double-precision floating-point variable. |
if | Performs conditional execution. |
else | Specifies an alternative block. |
for | Used to create a loop. |
while | Executes a loop while a condition is true. |
do | Used with while to create a do-while loop. |
break | Terminates a loop or switch statement. |
continue | Skips the remaining statements of the current loop iteration. |
switch | Selects one of several execution paths. |
case | Defines a case within a switch statement. |
default | Defines the default case in a switch statement. |
return | Returns control from a function. |
void | Specifies no value or no parameters in certain declarations. |
struct | Defines a structure. |
union | Defines a union. |
enum | Defines an enumeration. |
typedef | Creates an alternative name for a type. |
sizeof | Determines the size of a type or object in bytes. |
const | Specifies an object that cannot be modified through that identifier. |
static | Specifies static storage duration or internal linkage, depending on its use. |
extern | Declares an identifier with external linkage or refers to an object/function defined elsewhere. |
Example Program Using C Keywords
The following program uses different C keywords such as int, if, else and return.
निम्नलिखित प्रोग्राम में C Language के विभिन्न Keywords जैसे int, if, else तथा return का उपयोग किया गया है।
#include <stdio.h>int main(void){int number = 10;if (number > 0){printf("Number is positive.");}else{printf("Number is not positive.");}return 0;}
Output:
Number is positive.In this program, int, if, else and return are keywords. The word number is an identifier, and 10 is an integer constant.
इस प्रोग्राम में int, if, else तथा return Keywords हैं। number एक Identifier है तथा 10 एक Integer Constant है।
Important Points about Keywords in C
Keywords are reserved words with predefined meanings.
Keywords cannot be used as variable names or function names.
C language is case-sensitive.
The original ANSI C (C89/C90) standard contains 32 keywords.
C99 introduced five additional keywords, making a total of 37.
sizeofis a single keyword.typedefis a keyword, whereastypeis not a C keyword.Later C standards introduced additional keywords.
Keywords Reserved Words होते हैं जिनका अर्थ पहले से निर्धारित होता है।
Keywords का उपयोग Variable Name या Function Name के रूप में नहीं किया जा सकता है।
C Language Case-Sensitive होती है।
Original ANSI C (C89/C90) Standard में 32 Keywords हैं।
C99 Standard में पाँच अतिरिक्त Keywords शामिल किए गए, जिससे इनकी कुल संख्या 37 हो गई।
sizeofएक ही Keyword है।typedefएक Keyword है, जबकिtypeC Language का Keyword नहीं है।बाद के C Standards में और भी Keywords शामिल किए गए हैं।
Comments
Post a Comment