scanf("%d",a); will be scanf("%d",&a);
Soorry, 'i' is wrong it will be 'cnt' everywhere in the previous one.
Can this be the solution? void main() { for(int cnt = 0; cnt < 5; ++cnt) { OutVar[cnt] = Arr[(i+1)%5]...
Separate names with a comma.