Answers for "arithmetic operators in php"

PHP
0

arithmetic operators in php

<?php
// arithmetic operator
$x = 3;
$y = 6;
$z = $x+$y; //addition
$a  =$x-$y; //substraction
$b = $x*$y; //multiplication
$c =$x/$y;  //devide
$d=$x**$y;  //exponential
$e = $x%$y; //modulus
echo "Addition: $z";

echo "<br>Substraction: $a";
echo "<br>Multiplication: $b";
echo "<br>Devision: $c";
echo "<br>Exponential: $d";
echo "<br>Modulus: $e";
?>
Posted by: Guest on September-03-2021
0

PHP Arithmetic Operators

// Arithmetic Operators 
    echo "<br>";
    echo "The value of varible1 + variable2 is ";
    echo $variable1 + $variable2;
    echo "<br>";
    echo "The value of varible1 - variable2 is ";
    echo $variable1 - $variable2;
    echo "<br>";
    echo "The value of varible1 * variable2 is ";
    echo $variable1 * $variable2;
    echo "<br>";
    echo "The value of varible1 / variable2 is ";
    echo $variable1 / $variable2;
    echo "<br>";
Posted by: Guest on August-25-2021

Code answers related to "arithmetic operators in php"

Browse Popular Code Answers by Language