Addition of two numbers in PHP using Function ||EasyCoding45

 <?php

function add($a,$b)

{

$c=$a+$b;

echo "<h1>Addition is :$c";

}

add(5,10);

?>

Output :-15

Explanation:-

1) opening php  structure.

2)defining user defined add function which is going to perform our addition task.

3) Storing addition of two values in $c variable .

4) and printing simple Addition message and value.

5) <h1> this tag is used to print big Letters only.

6) and last calling our add() function.

7) and finally closing our php structure.



Comments

Post a Comment