Program to find Factorial of a number in PHP
function factorial($n) { if ($n == 0) { return 1; } else { return $n * factorial($n - 1); } } // Taking input from the user $number = readline("Enter…
function factorial($n) { if ($n == 0) { return 1; } else { return $n * factorial($n - 1); } } // Taking input from the user $number = readline("Enter…
In the above example, the factorial() function takes the number n as a parameter and recursively calculates the factorial of that number. If n is 0 or 1, it returns…
In the above example, the fibonacci() function takes the number n as a parameter and generates the Fibonacci series up to the nth number. It uses an array $fib to…
Name of Post: DGMHUP Uttar Pradesh ANM / GNM Training Online Registration 2023 Post Date / Update: 02 July 2023 | 01:11 AM Short Information : Uttar Pradesh Department of…