A) auto
B) case
C) main
D) default
E) register
The accurate response to the query “Which one is not a reserved keyword in C language?” is option(C) Main.
Clarification:
main is not classified as a reserved keyword in C. It is a distinctive function utilized within the program. Although the C language standard mandates a main function for program execution, you are permitted to select any name. Nonetheless, it is highly advisable to use the main keyword as the initial point of entry.
Contents :
Reserved Keywords in C
In C programming, keywords are predefined reserved terms that possess specific meanings and dictate the behavior of various constructs within the language. Keywords cannot be employed as variable or function identifiers. Let’s explore the reserved keywords in the C language:
1. Auto Keyword in C
The keyword auto serves as a storage class specifier, establishing local variables with automatic storage by default. Initially, the auto keyword was employed to declare variables that possess automatic storage duration. While utilizing the auto keyword is no longer essential in contemporary coding, it continues to be recognized as a reserved keyword in C. It is important to note that the auto keyword is not supported before C11. Let’s examine how we can work with automatic storage:
Example :
#include <stdio.h>
void function() {
int x = 10; // Declare x as an integer, no need for 'auto'
printf("x = %dn", x);
}
int main() {
function();
return 0;
}
Output:

In this instance, x will have automatic storage duration by default, considering the auto keyword has not been applied.
2. Case Keyword in C
Case is a reserved keyword in C. It is applied within a switch statement to establish a branch of code that will execute if a particular value of the switch expression corresponds to a defined constant value.
The switch keyword commences the switch statement, the case keyword specifies each branch, while the default keyword outlines what occurs if no case aligns.

- The switch keyword initiates the switch statement.
- The case keyword determines an execution according to a constant value.
- The break keyword exits the switch block.
- The default keyword operates if no case constant corresponds to the expression.
Example:
#include <stdio.h>
int main() {
int x = 2;
switch (x) {
case 1:
printf("x is 1n");
break;
case 2:
printf("x is 2n");
break;
default:
printf("x is neither 1 nor 2n");
}
return 0;
}
Output:

In this example, the case keyword permits the program to segregate into particular code sections based on the value of x. Each case corresponds to a specific value and executes the associated block if the value matches.
3. Default Keyword in C
Default is classified as a reserved keyword in C. This keyword features in switch statements to define the default block of code that runs if no corresponding case is located.
- The switch keyword starts the switch statement.
- The case keyword specifies an execution coinciding with a constant value.
- The break keyword concludes the switch block.
- The default keyword triggers when no case constant resonates with the expression.
Example:
#include <stdio.h>
int main() {
int x = 9;
switch (x) {
case 1:
printf("x is 1n");
break;
case 2:
printf("x is 2n");
break;
default:
printf("x is neither 1 nor 2n");
}
return 0;
}
Output:

In this scenario, the default keyword enables the program to branch into specific code blocks corresponding to the value of x. If no case matches the distinct value, it resorts to the default case.
4. Register Keyword in C
Register is a reserved keyword in C. It indicates that a variable ought to be maintained in a CPU rather than in memory for swifter access. Contemporary compilers typically disregard this suggestion and manage optimizations themselves, since they can perform it more effectively than an individual developer.
Example:
#include <stdio.h>
int main() {
register int i;
for (i = 0; i < 5; i++) {
printf("i = %dn", i);
}
return 0;
}
Output:

register int i signifies the declaration of the variable i as a register variable, suggesting to the compiler to keep it in a register for quicker access.
Conclusion
To sum up, main is not a reserved keyword in C; it merely acts as the entry point for a program. All remaining choices—auto, case, default, and register—are reserved keywords with designated functions in C.
The post Which one is not a reserved keyword in C language first appeared on Intellipaat Blog.