filmov
tv
Recursive function in PHP in Hindi | print decreasing counting

Показать описание
Recursive function in PHP
A function that calls itself from its own body is called a recursive function and this technique is called recursion. A recursive function calls itself repeatedly until a certain condition is met.
Every recursive function has some condition that helps in the termination of the recursive calls, called a base case or termination condition.
If there is no base case in the recursive function, the recursive function will continue to repeat continuously.
It solves the original problem via the smaller subproblems.
1. WAP to print counting in decreasing order using the recursive function.
function printdec($n)
{
if ($n==0)
return;
echo $n," ";
printdec($n-1);
}
printdec(10);
Find Notes
Learn PHP from beginning
Learn C Language from beginning
Learn C++ from beginning
Learn Java from beginning
Learn Python from beginning
#tarunsir #phptutorial #learnprogramming #php #recursion #function
A function that calls itself from its own body is called a recursive function and this technique is called recursion. A recursive function calls itself repeatedly until a certain condition is met.
Every recursive function has some condition that helps in the termination of the recursive calls, called a base case or termination condition.
If there is no base case in the recursive function, the recursive function will continue to repeat continuously.
It solves the original problem via the smaller subproblems.
1. WAP to print counting in decreasing order using the recursive function.
function printdec($n)
{
if ($n==0)
return;
echo $n," ";
printdec($n-1);
}
printdec(10);
Find Notes
Learn PHP from beginning
Learn C Language from beginning
Learn C++ from beginning
Learn Java from beginning
Learn Python from beginning
#tarunsir #phptutorial #learnprogramming #php #recursion #function