Take a look at this line:
for (i=n+1; n+10;i++)
Remember how a for-loop works?
The format is:
for (initial condition; exit condition; step amount)
So you have the initial condition set (i = n + 1)
But the exit condition is just n+10, which evaluates to true (greater than 0), and only loops once.
You need something like this:
for (i=n+1; i < n + 10; i++)
Which will loop until i is greater than or equal to n+10.