As known, there are two types of arrays, static and dynamic. Static arrays size is defined at compile time, dynamic array size is defined using malloc. In this code you can see that I haven't use malloc and I am dealing with dynamic array and my all array`s operations are running.
int main()
{
int capofarr,sizeofarr,i,choice,choice2,ele,pos,choice3;
printf("enter the size of array:");
scanf("%d",&capofarr);
int arr[capofarr];
printf("Enter the element that you want to store in array:");
scanf("%d",&sizeofarr);
if(capofarr>=sizeofarr)
{
for(i=0;i<=sizeofarr-1;i++)
{
printf("Enter value of arr[%d]=",i+1);
scanf("%d",&arr[i]);
}