Ad

PHP Arithmetic Operators

 PHP Arithmetic Operators 

PHP Arithmetic operators


Arithmetic Operators:

  • Addition (+)
  • Subtraction (-)
  • Multiplication (*)
  • Division (/)
  • Modulus (%)
  • Exponentiation (**)

Arithmetic Operators php

Example :-

<?php
$no1 = 20;
$no2 =5;
//ope
$add =$no1 + $no2;
$sub= $no1 - $no2;
$multi= $no1 *$no2;
$divi =$no1 / $no2;
$remainder = $no1 % $no2;

//out
echo "Addition =".$add;
echo"<br>subtraction =".$sub;
echo "<br> multiplication =".$multi;
echo "<br> division=".$divi;
echo"<br> remainder = ".$remainder;
?>

Arithmetic Operators php

Output :-

Addition =25
subtraction =15
multiplication =100
division=4
remainder = 0

Related post :-

Classes in javascript

get method php

change password form

No comments

Powered by Blogger.