Variable
Variable is an identifier which holds data or another one variable is an identifier whose value can be changed at the execution time of program. Variable is an identifier which can be used to identify input data in a program.Syntax: Variable_name = value;
Rules to declare a Variable
- Every variable name should start with either alphabets or underscore ( _ ) or dollar ( $ ) symbol.
- No space are allowed in the variable declarations.
- Except underscore ( _ ) no special symbol are allowed in the middle of variable declaration
- Variable name always should exist in the left hand side of assignment operators.
- Maximum length of variable is 64 characters.
- No keywords should access variable name.
Variable declarations
syntax:
Datatype variable_name;
byte b1;
Variable initialization
It is the process of storing user defined values at the time of allocation of memory space.
Variable assignment
Value is assigned to a variable if that is already declared or initialized
syntax:
Variable_Name = value;
int a = 140;
syntax:
Datatype variable_name; byte b1;
Variable initialization
It is the process of storing user defined values at the time of allocation of memory space.
Variable assignment
Value is assigned to a variable if that is already declared or initialized
syntax:
Variable_Name = value;
int a = 140;
int a = 140;
0 comments:
Post a Comment