Originally Posted by
Salem
You could start with this idea.
Thank you you're idea is very useful.
I've written code that can store N numbers in array and It can remove any number from array
I don't want to store and remove number in array every time
I've decided to use function.
when I call to function1 It should be store numbers
when I call to function2 It should be remove requested number
Code:
#include<stdio.h>
int main (void)
{
int i, N, R;
printf("size of numbers: " );
scanf("%d",&N);
int Number[N];
for(i=0; i<N; i++)
{
printf("print Number : ", Number[i]);
scanf("%d",&Number[i]);
}
printf("Remove number : " );
scanf("%d",&R);
for(i=R; i<N; i++)
{
Number[i] = Number[ i + 1];
}
for(i=0; i< N-1; i++)
{
printf(" %d ", Number[i]);
}
return 0;
}
I've to pass the number that I want to remove number. I don't understand how to implement function that remove number from array.