Javatpoint Logo
Javatpoint Logo

Subtracting Two Numbers

There are three methods to subtract two numbers:

  • Subtraction in simple code in PHP
  • Subtraction in form in PHP
  • Subtraction without using arithmetic operator (+).

Subtraction in Simple Code

Subtraction of two numbers 30 and 15 is shown.

Example:

Output:

PHP Subtracting two numbers 1

Subtraction in Form

By inserting values in the form two numbers can be subtracted.

Example:

Output:

PHP Subtracting two numbers 2

Subtraction in Form without (-) Operator

By inserting values in the form two numbers can be subtracted but without using (-) operator.

Example:

Output:

PHP Subtracting two numbers 3
Next TopicArea of Triangle




15357
Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA