Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.14 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int fun(int n)
  4. {
  5. if(n==0)
  6. return 0;
  7. else
  8. return fun(n-1)+n;
  9. }
  10. int main()
  11. {int a=fun(5);
  12. cout<<a;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement