programm for factorial

Answer Posted / koushikgraj

<?php
function get_factorial_value($val)
{
$fact=1;
for($i=$val;$i>=1;$i--)
$fact=$fact*$i;
return $fact;
}
get_factorial_value(6);
?>

Is This Answer Correct ?    10 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What the limitation of header() function in php?

503


Why php is also called as scripting language?

548


Which php framework is fastest?

504


What is class extend in php?

531


Which array function checks if the particular key exists in the array?

490






How many types of arrays are there in php?

531


What is php pathinfo?

579


What is csrf verification?

525


Does php have multiple inheritance?

500


Tell me how can we get the error when there is a problem to upload a file?

496


Why namespace is used in php?

534


Tell me how can we change the maximum size of the files to be uploaded?

542


How to pass variables and data from php to javascript?

507


What are the differences between php constants and variables?

507


What difference between require() and require_once()?

550