Technology has advanced to the point where programming has become an essential part of our lives. We use software and applications for communication, entertainment, education, and work, and these are all built on programming languages.

Variable, Keyword and constant

Variables are the container/store house for any data that is inputted. To acquire space for the data to provide, space should be given name. Variables are just symbolic representation of memory location. For example:
 a, x, y, abc, ab1 etc

Rules for writing variables:
  • A variable can have alphabets, digits and underscore
  • A variable name must start with alphabets or underscore but not with digit
  • No whitespace is allowed within in variable name
  • A variable name must not be reserved keyword
Keyword
A reserved word in C programming is known as keyword. Keyword cannot be used as variable name.
These are the keyword of C programming
  1. auto
  2. break
  3. case
  4. continue
  5. register
  6. char
  7. const
  8. do
  9. double
  10. while
  11. default
  12. else
  13. if
  14. goto
  15. for
  16. long
  17. return
  18. short
  19. signed
  20. long
  21. register
  22. switch
  23. typedef
  24. union
  25. struct
  26. void
  27. volatile
  28. int
  29. float
  30. extern
  31. enum
  32. volatile
 Constant
A constant is a value or variable that cannot be changed in the program. For example 10, 20, 'a', 'b' etc

Share:

No comments:

Post a Comment

If you have any doubt, let me know...

Translate

Wikipedia

Search results