11. Variables in C Programming


Variables :
In programming, a variable is a container (storage area) to hold data.
To indicate the storage area, each variable should be given a unique name (identifier).
Variable names are just the symbolic representation of a memory location.
For example:
                         int playerScore = 95 ;
Here, playerScore is a variable of integer type.
Here, the variable is assigned an integer value 95.

Rules for naming a variable :
1. A variable name can have letters (both uppercase and lowercase letters), digits and
underscore only.
2. The first letter of a variable should be either a letter or an underscore.
3. There is no rule on how long a variable name (identifier) can be. However, you may run into problems in some compilers if variable name is longer than 31 characters.

Comments

Popular posts from this blog

13. Control Strings in C Programming

12. Library Functions of C Programming

3. What is programming language ?

17. Constants/Literals in C programming

7. Introduction of C programming :

2. Requirement of Computer Programming

15. Basic Input/output functions in C programming

14. Escape Sequences in C Programming

4. What is Compiler ?