Advertisement
Josif_tepe

Untitled

Apr 30th, 2021
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.20 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int sum(int i) {
  5.     if(i == 11) {
  6.         return 0;
  7.     }
  8.     return sum(i + 1) + i;
  9. }
  10.  
  11. int main() {
  12.    
  13.     printf("%d\n", sum(1));
  14.     return 0;
  15. }
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement