Assignment Statement - Research Article from World of Computer Science

This encyclopedia article consists of approximately 2 pages of information about Assignment Statement.

Assignment Statement - Research Article from World of Computer Science

This encyclopedia article consists of approximately 2 pages of information about Assignment Statement.
This section contains 468 words
(approx. 2 pages at 300 words per page)
Buy the Assignment Statement Encyclopedia Article

The assignment statement is the simplest expression in computer programming. Most programming languages use the conventional mathematical symbol = (the "equals" sign) to indicate assignment, but there are exceptions such as Pascal, which uses := (a colon and an "equals" sign).

In an assignment statement an expression is evaluated and the result stored in a variable in the program. The general form of the assignment statement is:

  • result = expression

A very simple example of a real assignment statement is:

  • int i = 3;

Although the number 3 is a constant, it is also an expression that evaluates to the number 3. At the end of the statement, the variable "i" contains this number. It is important to note that the data type that the expression evaluates to must be the same type as the result. Most languages have implicit conversion rules built into them to cope with converting between the primitive data...

(read more)

This section contains 468 words
(approx. 2 pages at 300 words per page)
Buy the Assignment Statement Encyclopedia Article
Copyrights
Gale
Assignment Statement from Gale. ©2005-2006 Thomson Gale, a part of the Thomson Corporation. All rights reserved.