Your code is confused !
Here is a first correction which gives you the first part of the wanted result.
#include <stdio.h>
#include <stdlib.h>
int main() {
static int i;
for(i=0; i<11; i++) {
printf("%d",i);
}
return 0;
}
I let you complete the code for the end of the result.
Nota: it is a good habit to always initialise all your variables. you see that my code don't use uninitialised variables contrary to your code.
[Update]
Ok the piece of code do only half of the job. Here is a lead to solution:
Actual piece of code use f(x)= x
In text below:
x -5 -4 -3 -2 -1 0 1 2 3 4 5
f(x)=x -5 -4 -3 -2 -1 0 1 2 3 4 5
? 5 4 3 2 1 0 1 2 3 4 5
? -5 -4 -3 -2 -1 0 -1 -2 -3 -4 -5
? 5 6 7 8 9 10 9 8 7 6 5
line 1 is values of x
line 2 is actual f(x)
which mathematical function gives results of line 3 ?
What change gives results of line 4 ?
What change gives results of line 5 ?