Open In App

Keywords in C

Last Updated : 13 Jul, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

Keywords are predefined or reserved words that have special meanings to the compiler. These are part of the syntax and cannot be used as identifiers in the program. A list of keywords in C or reserved words in the C programming language are mentioned below:

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

We cannot use these keywords as identifiers (such as variable names, function names, or struct names). The compiler will throw an error if we try to do so.

Example:

C
#include <stdio.h>

int main() {
    int return = 10;   
    printf("%d\n", return);
    return 0;
}

Output

./Solution.c: In function 'main':
./Solution.c:4:9: error: expected identifier or '(' before 'return'
int return = 10;
^
./Solution.c:5:20: error: expected expression before 'return'
printf("%d\n", return);
^

Let's categorize all keywords based on context for a more clear understanding.

CategoryKeywords

Data Type Keywords

char, int, float, double, void, short, long, signed, unsigned

Operator & Utility Keywords

sizeof, return, goto, typedef

Control Flow Keywords

if, else, switch, case, default, for, while, do, break, continue

Storage Class Keywordsauto, register, static, extern
Type Qualifiersconst, volatile
User Defined Typesstruct, union, enum

Difference Between Keywords and Identifiers

KeywordsIdentifiers
Reserved Words in C that have a specific meaning and use in the syntaxNames given to variables, functions, structs, etc.
Cannot be used as variable names.Can be used as variable names (if not a keyword).
Examples: int, return, if, whileExamples: x, total, count
Part of the C language grammar.User-defined, meaningful names in the code.
Cannot be redefined or repurposed.Can be defined redefined and reused as needed.

Difference Between Variables and Keywords

VariablesKeywords
Used to store data and manipulate dataReserved words used to define structure and control flow
Created by the user using valid identifiersDefined by C standard and recognized by the compiler
Examples: age, total, marksExamples: for, while, int, return
Can hold values and be used in operationsUsed to define the structure of C code.
Naming is flexible within identifier rulesNames are fixed and cannot be altered or used differently

Next Article
Article Tags :

Similar Reads