Algo 2545
Algo 2545
Void call(int m)
{
if(m>5){
return 0;
}
call(m+1);
printf(“%d\n”,m);
}
Int main()
{
call(1);
return 0;
}
In the above the if codition is used to stop the program when it agrees with the
condition.
Recursive calls:
Calls to the current method.
Each recursive calls Should be defined so that it makes progress towards the base
case.
Types of Recursion:
Single and Multiple recursion:
• EXAMPLE:
STRING A = "ACBAED";
STRING B = "ABCADF";
int m = strlen(X);
int n = strlen(Y);
return 0;
}
THANK YOU.