Hi

I have this problem..

if n<=7, seq(n)=10

if n>7, seq(n)= 3*n+seq(n-1)-21

I must use recursion, iv'e made something like that but i have always segmentation fault.

Code:int seq(int n) { if(n<7) //under 7 i must use seq(10) { return(3*n+seq(n-1)-21); } else { return(3*n+seq(n-1)-21); } return 0; }

What's wrong with this??