Home C Programming Language / Programs / Program to Demonstrate Keywords and Identifiers in C Language
🚀 Programming Example

Program to Demonstrate Keywords and Identifiers in C Language

👁 12 Views
💻 Practical Program
📘 Step Learning
Learn this program step-by-step with algorithm, source code, output and detailed explanation.
No previous program
No next program

📌 Information & Algorithm

  1. Start the program.
  2. Declare an integer variable named age.
  3. Assign a value to the variable.
  4. Display the value using the printf() function.
  5. Observe the keywords and identifiers used in the program.
  6. End the program.

💻 Program Code

#include <stdio.h>

int main()
{
    int age = 25;

    printf("Age = %d", age);

    return 0;
}
                        

🖥 Program Output

Age = 25
                            

📘 Explanation

This program demonstrates the use of keywords and identifiers in C. Keywords are reserved words that have predefined meanings, whereas identifiers are user-defined names used for variables, functions, arrays, and other program elements.

In the above program, several keywords and identifiers are used. Understanding the difference between them is essential for writing valid C programs.

Category Example Description
Keyword int A reserved word used to declare an integer data type.
Keyword return Used to return control from the function.
Identifier main Name of the main function where program execution begins.
Identifier age User-defined variable used to store an age value.
Identifier printf Standard library function used to display output.

Here, int and return are keywords because they are predefined by the C language. The names main, age, and printf are identifiers because they identify program elements such as functions and variables. Identifiers help programmers give meaningful names to data and functions, making programs easier to read and maintain.

No previous program
No next program
📚 Learning Subject

Master Programming Through Practical Examples

Improve your coding logic, problem-solving skills and programming confidence by practicing real-world examples with explanations.

🎯 How to learn from this example

First understand the algorithm carefully. Then study the program line-by-line and compare it with the output. Finally, review the explanation section to strengthen your logic and programming understanding.

🔥 Practice suggestion

Rewrite the program without looking at the code. Modify values, conditions or logic and run it again. This helps improve confidence and strengthens coding skills much faster.