Variable


A symbol or name that stands for a value. For example, in the expression

x+y

x and y are variables. Variables can represent numeric values, characters, character strings, or memory addresses.

Variables play an important role in computer programming because they enable programmers to write flexible programs. Rather than entering data directly into a program, a programmer can use variables to represent the data. Then, when the program is executed, the variables are replaced with real data. This makes it possible for the same program to processdifferent sets of data.

Every variable has a name, called the variable name, and a data type. A variable’s data type indicates what sort of value the variable represents, such as whether it is an integer, a floating-point number, or a character.

The opposite of a variable is a constant. Constants are values that never change. Because of their inflexibility, constants are used less often than variables in programming.

Read Also:

  • variable length

    Refers to anything whose length can vary. For example, in databases, a variable-length field is a field that does not have a fixed length. Instead, the field length varies depending on what data is stored in it. Variable-length fields are useful because they save space. Suppose, for example, that you want to define a NAME […]

  • variable-length record

    A record that has at least one variable-length field. The length of the entire record, therefore, varies according to what data is placed in the variable-length field.

  • variable length subnet mask

    Variable Length Subnet Mask, abbreviated as VLSM, is a means to specify a different subnet mask for the same network number on different subnets. With VLSM, a network administrator can use a long mask on networks with few hosts and a short mask on subnets with many hosts. To use VLSM, the routing protocol must […]

  • variant

    In virus and malware terms, a variant refers to new strains and slightly modified version of malware. Malware is often modified with new variants released to get as much mileage as possible from the original code.

  • vector

    (1) In computer programming, a one-dimensional array. A vector can also mean a pointer. (2) In computer graphics, a line that is defined by its start and end point.


Disclaimer: Variable definition / meaning should not be considered complete, up to date, and is not intended to be used in place of a visit, consultation, or advice of a legal, medical, or any other professional. All content on this website is for informational purposes only.