Thursday, July 17, 2014

Delete Element from Stack

#include
using namespace std;
int main()
{
int a[8]={1,2,3,4},i=7;
while(a[i]=='\0')
{
i--;
}
a[i]='\0';

for(i=0;i<8;i++)
{
cout<<a[i]<<endl;
}
return 0;
}

1 comment:

  1. #include
    using namespace std;
    int main()
    {
    int a[8]={1,2,3,4},i=7;
    while(a[i]=='\0')
    {
    i--;
    }
    a[i]='\0';

    for(i=0;i<8;i++)
    {
    cout<<a[i]<<endl;
    }
    return 0;
    }

    ReplyDelete