Professional Documents
Culture Documents
Programm
Programm
h>
#include<process.h>
#include<conio.h>
#include<stdio.h>
int n=20;
if(n>=20)
cout<<"\n\n overflow\n" ;
exit(0);
int pos;
else
pos = i+1;
break;
cout<<"\n\n";
char tmp;
for(int m =n-1;m>=pos;m--)
a[m+1]=a[m];
a[pos] = el;
n+=1;
cout<<"\n\n";
cout<<"\t"<<a[t]<<"\t";
return;
if(n==0)
cout<<"\nunderflow \n";
exit(0);
int i=0;
for(;i<n;i++)
if(a[i]==el)
break;
if(i ==n-1)
if(a[n-1]!=el)
return;
for(int j=i;j<n;j++)
a[j] = a[j+1];
n-=1;
cout<<"\n\n";
cout<<"\t"<<a[k]<<"\t";
return;
void main()
{
clrscr();
char a[20],el;
int ch;
cin>>n;
for(int i=0;i<n;i++)
cin>>a[i];
while(rep =='y')
cin>>ch;
if(ch==1)
cin>>el;
insert(a,el,n);
if(ch==2)
cin>>el;
del(a,el,n);
}
if(ch==3)
exit(0);
cout<<"\nenter y to continue\n";
cin>>rep;
getch();