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

find highest salary

8 Answers  


how to hidden querystring url please send sample program

2 Answers  


How data or variable can be receive or send from PHP to HTML page??

3 Answers   TCS,


What is polymorphism with example in php?

1 Answers  


When viewing an html page in a browser, the browser often keeps this page in its cache. What can be possible advantages/disadvantages of page caching? How can you prevent caching of a certain page (please give several alternate solutions)?

1 Answers  


What is default session time in php?

1 Answers  


how to insert, update data in database

4 Answers  


What is the difference between php and javascript?

1 Answers  


What are the difference between abstract class and interface in oops?

1 Answers  


How to find the position of the first occurrence of a substring in a string?

1 Answers  


What is the purpose of the '.frm' file extension? What do thes file contain?

1 Answers  


What is empty () in php?

1 Answers  


Categories