Answer to Question #320150 in Web Development for asdasd

Question #320150

PHP

includes all the arithmetic operators. Use them along with variables to print

equations to the browser. In your script, create the following variables:


$x=10;


$y=7;



Write code to print out the following:



10 + 7 = 17


10 - 7 = 3


10 * 7 = 70


10 / 7 = 1.4285714285714


10 % 7 = 3


1
Expert's answer
2022-04-02T15:47:06-0400
<!DOCTYPE html>
<html lang="en">
<head></head>
<body>
    <?php
        $x=10; 
        $y=7; 
        
        $result=$x+$y; 
        echo "$x + $y = $result<br />";   
        
        $result=$x-$y; 
        echo "$x - $y = $result<br />";   
        
        $result=$x*$y; 
        echo "$x * $y = $result<br />";   
        
        $result=$x/$y; 
        echo "$x / $y = $result<br />";   
        
        $result=$x%$y; 
        echo "$x % $y = $result<br />";   
    ?> 
</body>
</html>

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS