Outline
Sum of 3 digit no.
Reverse a number
Accepting a char and checking whether vowel or not.
Sum of 3 digit no.
<? PHP
$ a=10;
$b=20;
$c=10;
Echo”sum of three digit no.”=”($a+$b+$c);
?>
Reverse a number
<?PHP
$a=256;
Echo=$a;
$b=($a%10);
$c= (integer ) ($a/10);
$d=($c%10);
$e=(integer) ($c/10);
Echo “<br>”, $c; $d;
?>
Accepting a char and checking whether vowel or not.
<from Method ="post">
Enter a character = <input type ="text" name "char">
(input type =" <"Submit" name="OK"value="OK");
<form>
<? PHP
if (issest($post["OK"])){
$char=$ post "char"];
if($char="a"||$char="e"||$char=";||$char="a"||$char="v")
{
echo "It is a vowel";
}
else
echo " It is Not a vowel";
}
else
echo "It is not a vowel";
}
}
?>