BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan

BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan (http://bzupages.com/)
-   Data Structure (http://bzupages.com/32-data-structure/)
-   -   Program of STACK (http://bzupages.com/f32/program-stack-743/)

shmsa 16-09-2008 11:14 PM

Program of STACK
 
Code:

#include
void push(int stack[], int &top)
{
 int element;
if (top==4)
cout<<""< else
{
 cout<<"enter element to puch in stack===="<  cin>>element;
top++;
stack[top]=element;
}
}
void pop(int stack[],int &top)
{
 if (top==-1)
  cout<<"stack is empty"<  else
 {
 cout<<"poped element of stack is===="<  top--;
 }
}
void show(int stack[], int &top)
{
 for (int i=top;i>=0;i--)
  cout< }
void main()
{
 char opt='y';
 int stack[5];
 int top=-1;
 while (opt=='y')
 {
  cout<<"enter 'P' for PUSH"<   cin>>opt;
  if (opt=='p')
  push(stack,top);
  else
  if (opt=='o')
    pop(stack,top);
  else
  if (opt=='s')
    show(stack,top);
  else
    cout<<"you have entered werong character"<   cout<<"DO you want more y/n"<   cin>>opt;
 }//end of while
}// end of main


BSIT07-01 17-09-2008 01:02 AM

Re: Program of STACK
 
Thanks Shahrukh :book1::aicon_kissbutt:

.BZU. 17-09-2008 01:06 AM

Re: Program of STACK
 
Thanks for sharing Shamsa...
I really appreciate for this sharing...
Actually humaray latop say na yeh delete ho gai thei.

Danish Hussain 17-09-2008 11:57 AM

Re: Program of STACK
 
to ab dobara save kar lo naa...loatop mei

BSIT07-01 06-10-2008 02:04 AM

Re: Program of STACK
 
Dear! It's not executing
Can you please attach the original file .:2006092820255273:

BSIT07-01 06-10-2008 03:56 PM

Re: Program of STACK
 
1 Attachment(s)
I have attached the source file of Stack program.
download it.

.BZU. 09-10-2008 04:11 AM

Re: Program of STACK
 
Quote:

Originally Posted by UNKNOWN (Post 2281)
I have attached the source file of Stack program.
download it.

:tickedoff:Problem was on the site...
and now that issue has been resolved...:whipping:
Abh shamsa wala bhi execute karay ga... Insha Allah

Now I am happy...:yahoo: Because I have done all ...
:spaz:Just only losing two posts....:439:
Otherwise humari saari posted assignment kharab honay ka khatra tha...

Thanks GoD


All times are GMT +5. The time now is 06:23 PM.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.