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

What is the difference between the functions strstr() and stristr()?

0 Answers  


What are constructor and destructor in PHP?

0 Answers  


Is php 5 still supported?

0 Answers  


Do you know what is php?

0 Answers  


What is meant by public, private, protected, static and final scopes?

0 Answers  






What is session management php?

0 Answers  


What is the use of mysql_fetch_assoc in php?

0 Answers  


What is the difference between md5(), crc32() and sha1() crypto on php?

0 Answers  


what is php?

3 Answers  


I created a cookie with the value like '1A2A',now i want to update this value regularly (about 20 times in a minute) with the value '1A2A3A' , 3A is the new value,new value will vary on the request it may be 3A or 4A or 100A ,some times the cookie is updating with new value but not every time.Can any body suggest the solution

1 Answers  


What does PHP stand for?

7 Answers  


What is the sign to start variables in PHP?

0 Answers  


Categories