Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int dosomething (int n)
- {
- if (n != 0)
- return n+dosomething(n-1);
- else
- return n;
- }
- int main ()
- {
- int n;
- scanf("%d",&n);
- printf ("%d\n", dosomething(n));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement