adspace


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 is trait in php?

1069


Write a program using while loop?

1123


Name and explain five of the PHP error constants?

1040


how to detect a mobile device using php

1175


List some features of php that are deprecated in php7?

1025


What is difference between static and final in php?

1110


hello all, I need some sample placement papers in lion bridge.. can anyone help me?

2180


What sized websites have you worked on in the past?

1089


sort term descripttion form, report and uery

2255


if you run the app program all vendor open items are cleared but is it possible to reverse the again again open items please tell me the answer

1995


How to create a web form?

1114


Explain me is it possible to destroy a cookie?

1033


How to calculate the difference between two dates using php?

1147


What is the current stable version of php? What advance thing in php7?

1096


What is the difference between htmlentities() and htmlspecialchars()?

1095