PHP Program to Arithmetic Operators

In the following example PHP program that demonstrates the use of arithmetic operators :
Program :
<?php

$a = 10;
$b = 5;

// Addition
$result = $a + $b;
echo "Addition: $result <br>";

// Subtraction
$result = $a - $b;
echo "Subtraction: $result <br>";

// Multiplication
$result = $a * $b;
echo "Multiplication: $result <br>";

// Division
$result = $a / $b;
echo "Division: $result <br>";

// Modulus
$result = $a % $b;
echo "Modulus: $result <br>";

// Exponentiation
$result = $a ** $b;
echo "Exponentiation: $result <br>";

?>
Output :
Addition: 15
Subtraction: 5
Multiplication: 50
Division: 2
Modulus: 0
Exponentiation: 100000
In this example, we have declared two variables `$a` and `$b` and assigned them the values `10` and `5`, respectively.

We then perform arithmetic operations using various operators and store the results in the `$result` variable. Finally, we print out the results using the `echo` statement.