/* CellSplit -# of cells doubles after each day -calculate the number of cells at a given day using recursion example: day 1 | # cells 1 1 2 2 3 4 4 8 5 16 */ #include #include #define N 10 int cellsplit(int n) { if(n == 1) //base case return 1; return 2*cellsplit(n-1); //recursive case } int main() { int x; x = cellsplit(N); printf("%d cells at day %d\n", x, N); system("pause"); }