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:-

example sheet 1 in php

		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:-

Practical assighment in php

		Figure 2
		

Similarly you can try many programs.

Email Address

For any query you can send mail at info@techaltum.com
Thanks