Advertisements
Advertisements
Question
Differentiate between the following:
Ordinary variable and array variable.
Distinguish Between
Solution
S. No. | Ordinary variable | Array variable |
1. | It refers to a single variable that can only contain one value. | A collection of variables with the same data type can have various values. |
2. | No index notation is used for ordinary variables. | In addition to the variable name, the index value must be given in square brackets. |
3. | Because it relates to a single variable, the .length method cannot be applied. | The .length method can be used to ascertain the array's size. |
shaalaa.com
Is there an error in this question or solution?