php arithmetic operators

Solutions on MaxInterview for php arithmetic operators by the best coders in the world

showing results for - "php arithmetic operators"
Zacharie
04 Mar 2016
1// Arithmetic Operators 
2    echo "<br>";
3    echo "The value of varible1 + variable2 is ";
4    echo $variable1 + $variable2;
5    echo "<br>";
6    echo "The value of varible1 - variable2 is ";
7    echo $variable1 - $variable2;
8    echo "<br>";
9    echo "The value of varible1 * variable2 is ";
10    echo $variable1 * $variable2;
11    echo "<br>";
12    echo "The value of varible1 / variable2 is ";
13    echo $variable1 / $variable2;
14    echo "<br>";
Gwendoline
10 Aug 2018
1<?php
2// arithmetic operator
3$x = 3;
4$y = 6;
5$z = $x+$y; //addition
6$a  =$x-$y; //substraction
7$b = $x*$y; //multiplication
8$c =$x/$y;  //devide
9$d=$x**$y;  //exponential
10$e = $x%$y; //modulus
11echo "Addition: $z";
12
13echo "<br>Substraction: $a";
14echo "<br>Multiplication: $b";
15echo "<br>Devision: $c";
16echo "<br>Exponential: $d";
17echo "<br>Modulus: $e";
18?>