Added Recursion Problems of C language
Pull Request checklist -
- [ ] This pull request fixes #issue_reference (Create an issue if not already present.)
- [ ] The directory structure is of the form (directory_name) (If directory doesn't exist, create a new.)
- [ ] Don't duplicate stuff.
Make sure all the above conditions are met before a PR is created.
Yes correct! Thanks😀
On Fri, Oct 16, 2020, 9:06 AM Gareeb [email protected] wrote:
@Gareeb-coder commented on this pull request.
In Recursion/factorial.c https://github.com/hacktoberfest17/programming/pull/2185#discussion_r506027304 :
+#include<stdio.h> +int sum(int); +main() +{
- int x,z;
- printf("Enter the value of x:\n");
- scanf("%d",&x);
- z=sum(x);
- printf("The sum of %d numbers is %d.\n",x,z); +} +int sum(int a) +{
- int s;
- if(a==1)
return(a);- s=a*sum(a-1);
There is no need of s variable here, u can also write like this return( asum(a-1) );*
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/hacktoberfest17/programming/pull/2185#pullrequestreview-509988604, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARF7GA2DBZH3CL4LAVI33FTSK65UDANCNFSM4SGPUSPQ .