Calculator
<?php while(1){ echo "FirstNum : " ."\n" ; $FirstNum = readline(); echo "SecondNum :" . "\n" ; $SecondNum = readline(); echo "Choose a Function :" . "\n" ; $n = readline(); if( $n == 1){ $R = $FirstNum + $SecondNum ; }elseif($n == 2){ $R = $FirstNum - $SecondNum ; }elseif($n == 3){ $R = $FirstNum * $SecondNum ; }elseif($n == 4){ $R = $FirstNum / $SecondNum ; }elseif($n == 5){ $R = $FirstNum ** $SecondNum ; }elseif ($n == "Exit"){ break ; } echo "Result = $R" ; echo "\n"; } ?>