Hi,
Let's say I have an array of 10 elements. I want user to enter 9 numbers so that they fill arrays 0 to 8 (9 numbers).
Now I shift the arrays +1. so array[0] is now array[1] and so on.
Now I ask user to enter 10th number (fills array 0).
how can I do that??
Here's my code(it doesn't shift arrays and doesn't ask for 10th num)
int main()
{
int a[10];
int i;
printf("\nEnter 9 numbers:\n");
for(i=0;i<9;i++)
{
printf("%10d numbers remaining\n\n", 9-i);
scanf("%d", &a[i]);
}
printf( "%s%13s\n", "Element", "Value" );
for(i=0;i<10;i++)
{
printf("%7d%13d\n",i, a[i]);
}
}