Advertisement
Nayeemzaman

output trace3

Dec 18th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.23 KB | None | 0 0
  1. #include<stdio.h>
  2. int dosomething (int n)
  3. {
  4.     if (n != 0)
  5.         return n+dosomething(n-1);
  6.     else
  7.         return n;
  8. }
  9. int main ()
  10.  
  11. {
  12.     int n;
  13.     scanf("%d",&n);
  14.     printf ("%d\n", dosomething(n));
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement