Sum of two numbers in php
Example in PHP
After variable, let's try some basic program in PHP.
Sum of Two Numbers
<?php
$fnum=10;
$snum=40;
$res=$fnum+$snum;
echo " The sum =$res";
?>
The output of this program as follows:-
Figure 1
Calculate Gross Salary
For Example:-
<?php
$sal=10000;
$hra=($sal*5)/100;
$gross_sal=$sal+$hra;
echo " The Gross Salary is $gross_sal";
?>
In this code I only declare the variable but didn't assign any value. The output of this code as follows:-
Figure 2
Similarly you can try many programs.