So i want to switch the elements of an array with 32 integers "n" times.
All elements should be on the next position and the last should be at the first.
I tried something like this:
while(scanf("%d", &n) != EOF)
{
for(int j=0; j<n; j++)
for(int i=1; i<31; i++)
{
t[0]=t[31];
tmp=t[i];
t[i]=t[i+1];
}
}
Im not sure how could I use the tmp variable to solve this problem.
this is the array's element:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
and it should look like this if the n=1:
32 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)