Skip to main content

Keywords in C

Keywords are reserved words that have a special, predefined meaning in the C language. You cannot use them as identifiers (variable names, function names, etc.) because the compiler treats them as part of its syntax. There are 32 keywords defined in ANSI C.

List of C Keywords

autobreak
casechar
constcontinue
defaultdo
doubleelse
enumextern
floatfor
gotoif
intlong
registerreturn
shortsigned
sizeofstatic
structswitch
typedefunion
unsignedvoid
volatilewhile

Example

int register;   // ❌ Invalid — 'register' is a keyword
int reg;        // ✅ Valid

Common Keywords and Their Uses

KeywordUse
int, float, char, doubleData type declarations
if, else, switch, caseDecision making
for, while, doLooping
break, continue, return, gotoJump statements
struct, union, enumUser-defined data types
constDeclare a constant value
voidNo return value / no parameters
sizeofGet size of a data type or variable
Keywords are always lowercase in C. Writing INT or While is not a keyword — it would be treated as an identifier.