programm for factorial



programm for factorial ..

Answer / 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

More PHP Interview Questions

How can you get web browser’s details using PHP?

0 Answers  


How to turn on the session support?

0 Answers  


What is a comment in php?

0 Answers  


When you will get the error "Cannot add header information"?

2 Answers  


What is php used for?

0 Answers  






How long will it take to learn php?

0 Answers  


Explain what is the difference between for and foreach?

0 Answers  


what will do ceil() and floor() in PHP?

5 Answers  


How can we extract string 'techinterviews.com' from a string 'http://www.techinterviews.com' using regular expression in PHP?

4 Answers  


What is namespace and use in php?

0 Answers  


Write a program to display table of a number using php?

0 Answers  


Is laravel better than codeigniter?

0 Answers  


Categories