CSE NotesCSE Notes
Simplifying Complexity

n C programming, keywords are reserved words that have special meaning in the language. They cannot be used as identifiers (e.g., variable names, function names). Here’s a list of C keywords, along with a brief description of each:

List of C Keywords

  1. Data Types
    • int: Represents integer data types.
    • float: Represents floating-point data types.
    • double: Represents double-precision floating-point data types.
    • char: Represents character data types.
  2. Control Flow
    • if: Used for conditional statements.
    • else: Used in conjunction with if for alternative conditions.
    • switch: Allows multi-way branching.
    • case: Defines a branch in a switch statement.
    • default: Specifies the default branch in a switch statement.
    • break: Exits from a loop or switch statement.
    • continue: Skips the current iteration of a loop and moves to the next.
    • return: Exits from a function and optionally returns a value.
  3. Looping
    • for: Starts a for loop.
    • while: Starts a while loop.
    • do: Used with while to create a do-while loop.
  4. Storage Class Specifiers
    • auto: Default storage class for local variables.
    • register: Suggests that a variable be stored in a register for faster access.
    • static: Indicates that a variable retains its value between function calls.
    • extern: Declares a variable that is defined in another file or scope.
  5. Type Qualifiers
    • const: Indicates that a variable’s value cannot be modified.
    • volatile: Indicates that a variable may change unexpectedly (used in hardware access).
  6. Input/Output
    • sizeof: Returns the size of a data type or variable.
  7. Others
    • void: Indicates no value or type, often used for functions that do not return a value.
    • struct: Defines a structure.
    • union: Defines a union (a data structure that can hold different data types).
    • enum: Defines an enumeration (a set of named integer constants).
    • typedef: Creates an alias for a data type.
    • goto: Transfers control to a labeled statement (not commonly used).
    • typedef: Used to create a new name for an existing type.

auto, double, int, struct,
break, else, long, switch,
case, enum, register, typedef,
char, extern, return, union,
const,float, short, unsigned,
continue, for, signed, void,
default, goto, sizeof, volatile,
do, if, static, while,