Arithmetic Operators में पांच प्रकार के Operators होते है |
Operators | Description |
---|---|
+ | Addition |
- | Subtraction |
* | Multiplication |
/ | Division |
% | Modulus |
Example for Addition(+)
Source Code :Output :123456<?php
$a = 10;
$b = 4;
$c = $a + $b;
echo "Addition of ".$a." and ".$b." is ".$c;
?>
Addition of 10 and 4 is 14
Example for Subtraction(-)
Source Code :Output :123456<?php
$a = 10;
$b = 4;
$c = $a - $b;
echo $c;
?>
6
Example for Multiplication(*)
Source Code :Output :123456<?php
$a = 10;
$b = 4;
$c = $a * $b;
echo $c;
?>
40
Example for Division(/)
Source Code :Output :123456<?php
$a = 10;
$b = 4;
$c = $a / $b;
echo $c;
?>
2.5
Example for Modulus(%)
Source Code :Output :1234567<?php
$a = 10;
$b = 4;
$c = $a % $b;
echo "Remainder : ".$c;
?>
Remainder : 2
0 comments:
Post a Comment
Thanks