```
#include <stdio.h>
#include <stdlib.h>
#define MAX 10

int main()
{
    int niz[MAX], i, pom; 

// two more var, n,m=0;

char c;

for(i=0;i<MAX;i++)
{
    niz[i]=rand()%100;
}
for(i=0;i<MAX;i++)
{
    printf("%d\n", niz[i]);
}

printf("\n\nEnter L(l) for left shift or R(r) for right shift\n");
scanf("%c", &c);

if(c=='L' || c=='l')
{

//while(m<n) and on the end n++; or for(m=0;m<n;m++)... you know what i mean 
//but its not working...

    pom=niz[0];
    for(i=0;i<MAX-1;i++)
    {
        niz[i]=niz[i+1];
    }
    niz[MAX-1]=pom;

    //for loop to shift array for 1 position
}

else if(c=='R' || c=='r')
{

//.....

    pom=niz[MAX-1];
    for(i=MAX-1;i>0;i--)
    {
        niz[i]=niz[i-1];
    }
    niz[0]=pom;
    //for loop to shift array for 1 position
}

for(i=0;i<MAX;i++)
{
    printf("%d\n", niz[i]);
}
return 0;
}

```

Ok this is code to shift array left or right for 1 position and it works fine. But if i want to shift array for n positons my first thought was ok just put code from IF and ELSE IF in one more loop which will repeat until some variable is increased to less than n, i tried puting code from IF and ELSE IF in while and for loop but its not working.. BTW is there some alternative to my way of shifting array for n positions... ?