Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

implement stack using stack.h headerfile functions

Answer Posted / sv

#include <iostream>
#include <stack>

using namespace std;

int main()
{
string title;
int howmany;


stack<string> discs;
//Asking the user how many discs he wants to enter in the
stack.
//The loop will rotate that many number of times and then
//prompt the user for input.
cout<<"How many discs :";
cin>>howmany;

for(int i=0;i>title;
//pushing the discs one upon the other
discs.push(title);
}

cout<<"Now at the top of the CD Stack we have :"<<discs.top
()<<endl;
cout<<"The first one entered is "<<endl;
while(!discs.empty())
{
title = discs.top();
discs.pop();
}
cout<<title<<endl;
return 0;
}

Is This Answer Correct ?    4 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Define a nested class.

1126


Which c++ operator cannot overload?

1075


Am pass the 10000 records to target in target I will take commit interval 15000 when I was stop the work flow what will happened

1609


What does it mean to declare a member function as virtual?

1120


What is the purpose of template?

1169


What is the best c++ ide?

1235


What is setf in c++?

1153


Tell me difference between constant pointer and pointer to a constant.

1273


Why ctype h is used in c++?

992


How did c++ start?

1151


What are libraries in c++?

1131


Write a Program for read a line from file from location N1 to N2 using command line arguments. Eg:exe 10 20 a.c

1336


What is the benefit of learning c++?

1044


What operators can you overload in c++?

1085


What are static member functions?

1158