Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.



Get Started Now!

Tutorial for Arithmetic operators

php

What is Arithmetic operators?

The arithmetic operator is used to do simple arithmetic operations such as adding, subtracting, multiplying, and so on. Simple arithmetic behavior of numerical values may be implemented using these operators. The table below demonstrates how the findings are used and what outcomes are achieved.

  • Operator Name Example Result
  • + Addition $x + $y Sum of $x and $y
  • Subtraction $x - $y Difference of $x and $y
  • * Multiplication $x * $y Product of $x and $y
  • Division $x / $y Quotient of $x and $y
  • Modulus $x % $y Remainder of $x divided by $y
  • ** Exponentiation $x ** $y Result of raising $x to the $y'th power (Introduced in PHP 5.6)

Example:-

Output:-

Ashwani Kumar
Latest posts by Ashwani Kumar (see all)
0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x