Variables:-
A variable is a space in the computer memory that is set aside for a certain kind of data and given a name for easy reference.A variable is one whose value can be change in the program, a variable can be assign a fix value or can also be a formula.
e.g num = 18; or
num = a*b ;
Following are the types of variables we used in C and C++ programming languages.
Integer two bytes
Float four bytes
Char 1 byte
String depends on numbers of characters
Variable Conventions:-
- Variable name is any combination of 1 to 31 alphabets, digits, or "_".
- The first character in the variable name must be an alphabet or "_".
- No coma or blanks are allowed within the variable name.
- No special symbol other than the "_" can be used in a variable name.
- A variable name must be a meaningful name according to specific program.
No comments:
Post a Comment