assignment statement

views updated

assignment statement A fundamental statement of all programming languages (except declarative languages) that assigns a new value to a variable. The typical form in Algol-like languages is variable := expression

where := is read as “becomes”; the symbol suggests a left-pointing arrow to signify the conveyance of a value to the variable on the left. Other languages (particularly Basic, C, and Fortran) use = as the assignment operator, e.g. a = b + c

This leads to problems in expressing the concept of equality. Basic, being an unsophisticated language, is able to use = for both purposes; C uses == for equality and Fortran uses .EQ.