C Programming/C Basics

C Keywords & Identifiers

Updated on January 8, 2026
2 min read

C Keywords

Keywords are reserved words in C that have a fixed meaning.

 They cannot be used as variable namesfunction names, or identifiers.

Total Keywords in C

C has 32 keywords.

Common C Keywords

S No.KeywordPurpose
1autoDeclares automatic variable
2breakExits a loop or switch
3caseSpecifies a branch in switch
4charCharacter data type
5constMakes variable constant
6continueSkips current loop iteration
7defaultDefault case in switch
8doStarts do-while loop
9doubleDouble precision floating type
10elseExecutes when if condition is false
11enumDefines enumeration
12externDeclares external variable
13floatFloating point data type
14forLooping statement
15gotoTransfers control
16ifConditional statement
17intInteger data type
18longLong data type modifier
19registerStores variable in CPU register
20returnReturns value from function
21shortShort data type modifier
22signedSigned data type
23sizeofFinds size of data type
24staticRetains value between calls
25structDefines structure
26switchMulti-way decision
27typedefCreates type alias
28unionDefines union
29unsignedUnsigned data type
30voidNo return type
31volatilePrevents optimization
32whileLooping statement

Example

int age;      // int is a keyword
return 0;    // return is a keyword

C Identifiers

Identifiers are names given by the programmer to variables, functions, arrays, etc.

Rules for Identifiers

  1. Must start with a letter (a–z, A–Z) or underscore (_)
  2. Cannot start with a number
  3. Cannot use keywords
  4. No special symbols except underscore
  5. Case-sensitive

Valid Identifiers

int total;
float marks;
int _count;

Invalid Identifiers

int 1num;     // starts with number
int total-marks; // special character
int int;      // keyword used

Difference Between Keywords and Identifiers

KeywordIdentifier
Reserved wordUser-defined name
Fixed meaningMeaning decided by programmer
Cannot be changedCan be changed
Example: intExample: age
C Keywords & Identifiers | C Programming | Learn Syntax