$a=5;
$b=6;
$c=$a+$b;
echo $c;
Now try a subtraction.
$a=8;
$b=10;
$c=$a-$b;
echo $c;
$a=3;
$b=14;
$c=$a*$b;
echo $c;// output 42
$a=3;
$b=14;
$c=$a/$b;
echo $c; //Output 0.21428571428571
The output of division can be formatted to required decimal places
kakuyaw | 06-03-2015 |
What is the value is not given, or not been initialize? Then what if i want to display my answer in textbox? Any idea? |
smo | 13-03-2015 |
Textbox value can be connected to display variable $c echo "<input type=text name=t1 value=$c>"; |