Keywords In C

Keywords In C

Keywords

In the C programming language, keywords are reserved words that have a specific meaning and cannot be used as identifiers (variable names, function names, etc.). 

Keywords are the words whose meaning has already been explained to the C compiler. There are only 32 keywords in C Programming language. 


1. auto: This keyword is used to declare local (automatic) variables.

2. break: The break keyword is used to exit from a loop or switch statement.

3. case: The case keyword is used in switch statements to define particular case values.

4. char: The char keyword is used to declare character variables or functions that return character type.

5. const: The const keyword is used to declare constants that cannot be modified.

6. continue: Used to skip certain statements inside the loop.

7. default: The default keyword is used in switch statements as a fallback option when none of the cases match.

8. do: The do keyword starts a do-while loop (iteration statement).

9. double: The double keyword is used to declare variables or functions that return double-precision floating-point values.

10. else: The else keyword is part of an if-else statement and specifies an alternative block of code to execute when the condition evaluates to false.

11. enum: The enum keyword defines an enumeration type, which allows you to create named constants with symbolic values.

12. extern: The extern keyword declares variables or functions that are defined externally (outside the current file).

13. float: The float keyword declares variables or functions that return single-precision floating-point values.

14. for: The for keyword starts a for loop, which repeatedly executes a block of code based on specified conditions (initialization, condition, and increment).

15. goto: The goto keyword is used to transfer control to a labeled statement within the same function.

16. if: The if keyword is used to perform conditional execution of code based on a specified condition.

17. int: The int keyword declares variables or functions that return integer values.

18. long: The long keyword declares variables or functions that return long integer values.

19. register: The register keyword suggests the compiler to store the variable in a CPU register for faster access (not commonly used nowadays).

20. return: The return keyword is used to exit from a function and optionally return a value.

21. short: The short keyword declares variables or functions that return short integer values.

22. signed: The signed keyword is used to declare variables of signed integer types (positive and negative values).

23. sizeof: The sizeof keyword returns the size in bytes of a data type or variable.

24. static: The static keyword is used to declare variables or functions with static storage duration, meaning they retain their values between function calls.

25. struct: The struct keyword defines a user-defined data type (structure) that can hold multiple variables with different data types under one name.

26. switch: The switch keyword starts a switch statement, which allows you to select one of many code blocks based on the value of an expression.

27. typedef: The typedef keyword allows you to create nickname for existing data types, making it easier to use complex types or improve code readability.

28. union: The union keyword defines a user-defined data type (union) that can hold different types of data in the same memory location.

29. unsigned: The unsigned keyword is used to declare variables of unsigned integer types (non-negative values only).

30. void: The void keyword is used as a return type for functions that do not return any value or as an argument type when no value needs to be passed.

31. volatile: The volatile keyword tells the compiler that a variable's value can be changed unexpectedly by external factors (e.g., hardware), so it should not optimize or cache its usage.

32. while: The while keyword starts a while loop (iteration statement).

Thanks For Visiting😊