Keywords types
Keywords are specific words or phrases that indicate the purpose or function of a piece of code. They are like navigational markers that guide the compiler to t...
Keywords are specific words or phrases that indicate the purpose or function of a piece of code. They are like navigational markers that guide the compiler to t...
Keywords are specific words or phrases that indicate the purpose or function of a piece of code. They are like navigational markers that guide the compiler to the appropriate part of the code.
There are two main types of keywords in C:
Built-in keywords: These are keywords that the compiler knows and understands directly, such as if, else, int, float, and void.
User-defined keywords: These are keywords that you create yourself, such as myVariable or functionCall.
Built-in keywords are used directly in the code, while user-defined keywords are used to name variables, functions, and other elements.
For instance, the keywords if and else are used to structure an if statement, while the keyword int is used to declare a new variable of type int.
Examples of built-in keywords:
c
if (condition)
{
// code to be executed if condition is true
}
else
{
// code to be executed if condition is false
}
int age = 30;
Examples of user-defined keywords:
c
int myVariable; // declares a variable named "myVariable"
void functionCall(int arguments) // defines a function named "functionCall"
Understanding keywords is crucial for mastering C syntax. By learning the different types of keywords and how to use them effectively, you can write clear and efficient code that can be easily understood by others