Variables:

Variable: In programming language, variable is a value. In general variables are used to store any type of data or information. That Variable value can be change, depending on conditions or on information passed to the program. Typically, a program consists of instruction s that instructions will tell the computer what to do and what do not to do. The data consists of constants or fixed values that never change and variable values (which are usually initialized to "0" or some default value because the actual values will be supplied by a program's user). Usually, both constants and variables are defined as certain data types. Each data type prescribes and limits the form of the data. Examples of data types include: an integer expressed as a decimal number, or a string of text characters, usually limited in length.

Syntax: dim a= 10
   
        Here a= Variable name
                10=assigned value of the variable


Rules to be followed by giving variable name:
1)Start Variable name with alphabets.
                  Example:  dim a (Correct Method)
                                  Dim 1 (Wrong Method)
                                  Dim $ (Wrong Method)


2)  Don’t use any special character. Except underscore.
 Example:   dim a_ (Correct Method)
                      Dim a$ (Wrong Method)
                      Dim a$ (Wrong Method)
 

 

No comments:

Post a Comment