Friday 17 May 2013

Practice Paper 1 - Basic programming example


Some basic Programming example in PHP

After variable, let’s try some basic program in PHP.

Program 1:- Sum of Two numbers

Following is the code:-
<?php
$fnum=10;
$snum=40;
$res=$fnum+$snum;
echo " The sum =$res";
?>


The output of this program as follows:-



Figure 1

Program 2:-calculate the Gross salary where hra is 5% of basic salary

Following is the code:-
<?php
$sal=10000;
$hra=($sal*5)/100;
$gross_sal=$sal+$hra;
echo " The Gross Salary is $gross_sal";
?>

The output of this code as follows:-



Figure 2

Similarly you can try many programs.

For any problem and query you can write me mail at info@techaltum.com


No comments:

Post a Comment