h>
#include<stdlib.h>
}
i++;
}
return -1;
}
int main()
{
int n,i,p,choice;
printf("enter the size of array ");
scanf("%d",&n);
adt *arr=createarray(n);
printf("enter the numbers in the array\n");
for(i=0;i<n;i++)
{
scanf("%d",&p);
setitem(arr,i,p);
}
while(1)
{
scanf("%d",&choice);
switch(choice)
{
case 1:
{
printf("enter the index no of which you want number\n");
int r;
scanf("%d",&r);
int q=getitem(arr,r);
printf("picked item is %d\n",q);
break;
}
case 2:
{
int m,n;
printf("enter the index and item you want to replace \n");
scanf("%d%d",&m,&n);
edititem(arr,m,n);
break;
}
case 3:
{
printf("enter the index of item you want to remove \n");
int z;
scanf("%d",&z);
removeitem(arr,z);
break;
}
case 4:
{
printf("enter the item you want to search \n");
int d;
scanf("%d",&d);
int e=searchitem(arr,d);
if(e==-1)
{
printf("no is not present in the list %d\n",i);
}
else
{
printf("no is present at location %d\n",e);
}
break;
}
case 5:
{
printf("sorted list is \n");
sort(arr);
}
case 6:
{
print(arr);
}
case 7:
exit(0);
}
}
return 0;
}