How do we get the value of $c in the following code? PHP Assignment operator. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How do we get the value of $c in the following code? PHP Assignment operator.

<html> <head> <title>Assignment Operators</title> </head> <body> <?php $a = 42; $b = 20; $c = $a + $b; /* Assignment operator */ echo "Addtion Operation Result: $c <br/>"; $c += $a; /* c value was 42 + 20 = 62 */ echo "Add AND Assigment Operation Result: $c <br/>"; $c -= $a; /* c value was 42 + 20 + 42 = 104 */ echo "Subtract AND Assignment Operation Result: $c <br/>"; $c *= $a; /* c value was 104 - 42 = 62 */ echo "Multiply AND Assignment Operation Result: $c <br/>"; $c /= $a; /* c value was 62 * 42 = 2604 */ echo "Division AND Assignment Operation Result: $c <br/>"; $c %= $a; /* c value was 2604/42 = 62*/ echo "Modulus AND Assignment Operation Result: $c <br/>"; ?> </body> </html>

7th Oct 2016, 4:46 PM
Joshua Myers
Joshua Myers - avatar
1 Answer
0
print or echo
22nd Feb 2017, 9:41 AM
Deni Abi Suma
Deni Abi Suma - avatar