Calculation

<?php
	/* initialization of variables */
	$a = 13;
	$b = 2;
	
	/* Calculation of Sum */
	$sum = $a + $b;
	
	/* Calculation of Subtract */
	$sub = $a - $b;
	
	/* Calculation of Multiplication */
	$mul = $a * $b;
	
	/* Calculation of Division */
	$div = $a / $b;
	
	/* Calculation of Modulus */
	$mod = $a % $b;
	
	echo "Sum: ".$sum;
	echo "<br />Subtract: ".$sub;
	echo "<br />Multiplication: ".$mul;
	echo "<br />Division: ".$div;
	echo "<br />Modulus: ".$mod;
?>




/* Output */
Sum: 15

Subtract: 11

Multiplication: 26

Division: 6.5

Modulus: 1

Comments (0)

  • To add your comment please or

We use cookies to improve your experience on our site and to show you personalised advertising. Please read our cookie policy and privacy policy.

Got It!