Javatpoint Logo
Javatpoint Logo

Adding Two Numbers

There are three methods to add two numbers:

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

Adding in Simple Code

Addition of two numbers 15 and 30 is shown here.

Example:

Output:

PHP Adding two numbers 1

Adding in Form

Two numbers can be added by passing input value in the form.

Example:

Output:

PHP Adding two numbers 2

Adding in Simple Code

Two numbers can be added by passing input value in the form but without using (+) operator.

Output:

PHP Adding two numbers 3



Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA