Keywords in C
Below is the list of keywords in C:
auto, break, case, char, const, continue, default, do, double, else, enum, extern, float, for, goto, if, int, long, register, return, short, signed, sizeof, static, struct, switch, typedef, union, unsigned, void, volatile, while
Example:
#include <stdio.h>
int main() {
// auto keyword
auto num = 10;
// char keyword
char initial = 'A';
// for keyword
for (int i = 0; i < 3; i++) {
printf("num = %d, initial = %c\n", num, initial);
}
// break keyword
for(int i=0; i < 10; i++) {
printf("%d ", i);
if(i == 5)
break;
}
return 0;
}
Output
num = 10, initial = A num = 10, initial = A num = 10, initial = A 0 1 2 3 4 5
What is Keyword in Programming?
Keywords are predefined or reserved words that have special meaning to the compiler. In this article, we will discuss about keywords in programming, its importance, and usage in different languages.
Contact Us