Mathematical Operations with Variables in PHP

Mathematical operations can be performed not only on numbers but also on variables. Let's add, for example, the values of two variables:

php<?php
  $a = 1;
  $b = 2;
  echo $a + $b; // will output 3
?>

It is not necessary to immediately output the result of the operation; you can first write it to some variable, and then output the value of that variable:

php<?php
  $a = 1;
  $b = 2;
  $c = $a + $b; // write the sum to variable $c
  echo $c;      // will output 3
?>
Задание 1

Create a variable $a with a value of 10 and a variable $b with a value of 2. Output their sum, difference, product, and quotient (result of division).

Задание 2

Create a variable $c with a value of 10 and a variable $d with a value of 5. Sum them up, and assign the result to variable $res. Output the value of variable $res.

Задание 3

Create a variable $a with a value of 1, a variable $b with a value of 2, and a variable $c with a value of 3. Output their sum.

Задание 4

Create a variable $a with a value of 10 and a variable $b with a value of 5. Subtract $b from $a and assign the result to variable $c. Then create a variable $d, assign it a value of 7. Add variables $c and $d, and write the result into variable $res. Output the value of variable $res.