PHP5/Operators

Advertisement


Question
**why does the result shown is not true for addition & subtraction???**

<?php
$x=10;
$y=3;


echo"The sum is" . $x+$y ."<br>";
echo"The subtraction is" .$x-$y."<br>";
echo"The product is" .$x * $y."<br>";
echo"The quotient is" .$x / $y."<br>";
echo"The remainder is" .$x % $y."<br>";
?>

Answer
You may try this.

<?php
$x=10;
$y=3;
$sum=$x+$y;
$difference=$x-$y;
$product=$x*$y;
$quotient=$x/$y;
$remainder=$x%$y;
echo "The Sum is $sum";
echo "<br>";
echo "The Difference is $difference";
echo "<br>";
echo "The product is $product";
echo "<br>";
echo "The quotient is $quotient";
echo "<br>";
echo "The remainder is $remainder";
echo "<br>";
?>

Please revert to me if you need further assistance.

Cheers !

PHP5

All Answers


Answers by Expert:


Ask Experts

Volunteer


Vimal Abraham

Expertise

I can be able to solve PHP, MySQL and Web Hosting (Linux) related issues that may include cPanel/WHM.

Experience

I have worked under various domains of web development including file sharing, social community, wallpaper management, image hosting, web hosting automation, shopping cart and payment gateway integration. My active portfolios include, http://www.4kwallpapers.in http://www.wallpicz.com

Education/Credentials
I have completed Bachelor of Engineering in Computer Science.

Awards and Honors
Have a Total of nine certificates in Inter and Intra College Competitions that includes technical quiz, program debugging and paper presentation (State Level).

©2016 About.com. All rights reserved.