so I am trying to do a couple of things. First I want to shift the array based on the user input. So let's say the user enters (in this order): 1, 2, 3, 4, 5. I want to shift it so that it becomes 2, 3, 4, 5, 1.
As you can see, this particular array is scalable, i.e the dimensions aren't fixed.
Code:
<stdio.h>
void arrayShift(int*a,int intLength);
int main(){
int arr[10]={0};//array for input numbers
int array =0;
printf("Enter the size of the array (MAX): ");
scanf("%d",&array);
printf("Now please enter your %d values: \n", array);
int i;
for(i =0; i < array; i++){
scanf("%d", arr+i);
}
return0;
}
Then I want to print out the and then create a function that multiplies each number by the one before it (after shifting it): so using the same numbers as before (2, 3, 4, 5, 1), we should get an output of 2, 6, 12, 20, 5.