Answers for "PHP Arithmetic Operators"

PHP
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
0

operators in php

if (condition)
   code to be executed if condition is true;
else
   code to be executed if condition is false;
Posted by: Guest on September-24-2020
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

Code answers related to "PHP Arithmetic Operators"

Browse Popular Code Answers by Language