arithmetic operators in php

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

showing results for - "arithmetic operators in php"
Matteo
13 Mar 2017
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?>
Alessio
24 Oct 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>";