Home  >  Article  >  What is the function of assignment statement?

What is the function of assignment statement?

藏色散人
藏色散人Original
2019-07-26 11:51:364099browse

What is the function of assignment statement?

#What is the role of the assignment statement?

The assignment statement means an assignment statement. The assignment statement is the most basic statement in the program. Its function is to assign the value of an expression to one or several variables.

The multiple assignment statement assigns the value of the expression to several variables at the same time. In this case, the names of the assigned variables should be written in order on the left side of the assignment number.

Multiple assignment statements assign the value of an expression to several variables at the same time. In this case, the names of the assigned variables should be written in order on the left side of the assignment number. Its general form is: N :=V:=...X:=E, where N,V,...,X——variables of the same type, E——expression.

In the operation of multiple assignment statements, first calculate the subscript appearing in the variable on the left side of the assignment number, then calculate the value of the expression on the right side of the assignment number, and finally assign the value of the expression on the right to all variables on the left .

General form

Form

The general form of multiple assignment statements is:

where N ,V,...,X——variables of the same type; E——expression.

Semantics

The semantics of the above form is to assign the expression on the right to the variables N, V,...,X.

Example

Multiple assignment statement:

The semantics is: assign 1 to three variables A, B, and C at the same time, that is, A: =1, B:=1, C:=1.

The above is the detailed content of What is the function of assignment statement?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn