RRB JE CBT2 : EXPERT
27 Jun

C Language Keywords (Reserved Words) – Complete List with Examples

The C programming language (ANSI C/C90) has 32 reserved keywords. These words have predefined meanings and cannot be used as identifiers (variable names, function names, etc.).

KeywordPurposeExample
autoDeclares a local automatic variableauto int x = 10;
breakExits a loop or switchbreak;
caseDefines a case in a switchcase 1:
charDeclares a character variablechar ch = 'A';
constDeclares a constantconst float PI = 3.14;
continueSkips the current loop iterationcontinue;
defaultDefault case in a switchdefault:
doStarts a do-while loopdo { ... } while(i<5);
doubleDeclares a double-precision floating-point variabledouble d = 12.56;
elseAlternative branch of an ifelse { ... }
enumDeclares an enumerationenum Day {MON,TUE};
externDeclares an external variableextern int x;
floatDeclares a floating-point variablefloat f = 5.5f;
forStarts a for loopfor(i=0;i<5;i++)
gotoJumps to a labeled statementgoto end;
ifConditional statementif(a>b)
intDeclares an integer variableint age = 20;
longDeclares a long integerlong population;
registerRequests storage in a CPU registerregister int i;
returnReturns from a functionreturn 0;
shortDeclares a short integershort x;
signedDeclares a signed variablesigned int x;
sizeofReturns the size of a type/objectsizeof(int)
staticDeclares a static variablestatic int count = 0;
structDeclares a structurestruct Student { ... };
switchMulti-way selection statementswitch(choice)
typedefCreates a type aliastypedef int Integer;
unionDeclares a unionunion Data { int i; float f; };
unsignedDeclares an unsigned variableunsigned int n;
voidIndicates no type or no return valuevoid display();
volatileIndicates a value may change unexpectedlyvolatile int flag;
whileStarts a while loopwhile(i<10)

Keyword Categories

CategoryKeywords
Data Typeschar, int, float, double, void
Type Modifiersshort, long, signed, unsigned
Storage Classesauto, register, static, extern
Decision Statementsif, else, switch, case, default
Loop Statementsfor, while, do
Jump Statementsbreak, continue, goto, return
User-Defined Typesstruct, union, enum, typedef
Special Keywordsconst, sizeof, volatile
Comments
* The email will not be published on the website.