Keywords in C

Keywords are reserved words in C which have a special meaning for the compiler. These words are already defined by the C language, so we cannot use them as variable names, function names or other identifiers.

Keywords form the basic structure and syntax of a C program. In standard C, there are 32 keywords.

Rules for Keywords

Important Rules:

  • Keywords cannot be used as identifiers.
  • Keywords are case-sensitive in C.
  • All C keywords are written in lowercase letters.
  • Using a keyword as a variable name gives a compilation error.

All 32 Keywords in C

Keywords Keywords Keywords Keywords
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

Example:

#include <stdio.h>

int main() {

    int age = 18;

    if (age >= 18) {
        printf("Eligible");
    }

    return 0;
}

Output:

Eligible

Explanation:

  • int is a keyword used to declare integer data type.
  • if is a keyword used for decision making in C.
  • return is a keyword used to return control from the function.
  • main, age and printf are identifiers, not keywords.
  • The condition age >= 18 checks whether the person's age is 18 or more.
  • Since the condition is true, printf() prints "Eligible" on the screen.

Valid vs Invalid Usage

// Valid
int number = 10;

// Invalid
int return = 5;   // return is a keyword

Output:

Compilation error

Explanation:

  • number is valid because it is not a keyword.
  • return is a reserved keyword, so using it as a variable name gives a compilation error.

Real-Life Analogy:

Just like traffic signs on the road have fixed meanings (we cannot change their meaning), keywords in C also have fixed meanings and cannot be used for anything else.

Summary:

  • Keywords are reserved words with fixed meaning.
  • C has 32 standard keywords.
  • Keywords are predefined by the C language.
  • They cannot be used as identifiers (variable names or function names).
  • Examples: int, float, if, return, while.

Welcome to ShikshaSanchar!

ShikshaSanchar is a simple and helpful learning platform made for students who feel stressed by exams, assignments, or confusing topics. Here, you can study with clarity and confidence.

Here, learning is made simple. Notes are written in easy English, filled with clear theory, code examples, outputs, and real-life explanations — designed especially for students like you who want to understand, not just memorize.

Whether you’re from school, college, or someone learning out of curiosity — this site is for you. We’re here to help you in your exams, daily studies, and even to build a strong base for your future.

Each note on this platform is carefully prepared to suit all levels — beginner to advanced. You’ll find topics explained step by step, just like a good teacher would do in class. And the best part? You can study at your pace, anytime, anywhere.

Happy Learning! – Team ShikshaSanchar