A Compound Assignment Statement .

Asked By 30 points N/A Posted on -

Hello Experts!

I just want to ask your ideas about Compound Assignment Statement in C++. I need ideas for my project in school. Please send me thoughts on how it works and its functions. Thanks in advance.

Answered By 985 points N/A #118209

A Compound Assignment Statement .


These assignment statement in C++ assess an expression and utilize the value to its target variables. These are utilized for the inner data movement and identifying computations which are the GET and the PUT statements with STRING option.

The Compound Assignment Statement Syntax consists of:

1. Reference – which identifies the target that should give to the assignment.

2. Compound Assignment Operator – which identifies the operator used to the reference and the compared expression before the assignment is created. The following are the list of operators allowed in compound assignments.

Compound assignment operator Meaning
+= Evaluate expression, add and assign
-= Evaluate expression, subtract and assign
*= Evaluate expression, multiply and assign
/= Evaluate expression, divide and assign
|= Evaluate expression, or and assign
&= Evaluate expression, and and assign
||= Evaluate expression, concatenate and assign
**= Evaluate expression, exponentiate and assign
¬= Evaluate expression, exclusive-or and assign

Operator was given to the target and the source and the output will be assigned to the target. Example is given below:

3. Expression – which identifies the expression which should be evaluated and converted.

To know more about it, you can click on the link below:

Assignment and Compound Assignment Statements

Login/Register to Answer

Related Questions