Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  34
Language: C/C++
Code:
#include <stdio.h>
#include <stdlib.h>

int sumR(int n);
int main(){
    int n;
    scanf("%d", &n);
    printf("sumR = ", sumR(n));
    return 0;
}
int sumR(int n){
    if(n == 1){
        return 1;
    }else{
        return n + sumR(n - 1);
    }
}          
          
Comments: