[ create a new paste ] login | about

Link: http://codepad.org/zWaMx2NY    [ raw code | output | fork ]

C, pasted on Jul 3:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
 #include <stdio.h>
 #include <stdlib.h>
 int SVR(int *v, int n){
        if(n == 0){
                      return 0;
        }
        else{
                     return v[n] + SVR(v, n-1);
        }
 }
 int main(){
       int A[3], s;
       A[0]=3;
        A[1]=2;
        A[2]=1;
        s = SVR(A, 2);
       printf("O resultado é: %d", s);
 }


Output:
1
2
O resultado é: 3
Exited: ExitFailure 17


Create a new paste based on this one


Comments: