Page 1 of 1

Stack_Main.cpp 1 #include 2 #include 3 #include 4 using namespace std 5 6 int main() 7 { 8

Posted: Sun Jul 03, 2022 9:58 am
by answerhappygod
Stack Main Cpp 1 Include Iostream 2 Include Conio H 3 Include Stack 4 Using Namespace Std 5 6 Int Main 7 8 1
Stack Main Cpp 1 Include Iostream 2 Include Conio H 3 Include Stack 4 Using Namespace Std 5 6 Int Main 7 8 1 (102.36 KiB) Viewed 16 times
#include <iostream>
#include <conio.h>
#include <stack>
using namespace std
int main()
{
x;
Stack< int, vector<> > iStack;
for (x = 2; x < 8; x += 2)
{
cout << "Pushing " << << endl;
.push(x);
}
cout << "The size of the stack is ";
cout << iStack.() << endl;
for (x = 2; x < 8; x += 2)
{
cout << "Popping " << iStack.() << endl;
iStack.pop();
}
Stack_Main.cpp 1 #include <iostream> 2 #include <conio.h> 3 #include <stack> 4 using namespace std 5 6 int main() 7 { 8 X; 9 10 11 for (x = 2; x<8; x + 2) 12 { 13 cout << "Pushing " <<<< endl; 14 .push(x); 15 16 17 18 19 20 Stack< int, vector<> > iStack; } cout << "The size of the stack is "; cout << iStack. () << endl; for (x = 2; x<8; x + 2) { 21 22 cout << "Popping " << iStack. () << endl; 23 iStack.pop(); 24 25 } 84% (21:2) Guide Collapse Stack STL (10 pts) Debug all the errors found in the given C++ program that implements an STL for Stacks. To run your program and see the output, click the button below: TRY ME! V Stack_Main.cpp:2:10: fatal error: conio.h: No such file or directory #include <conio.h> A~~~~~~ ~~~~ compilation terminated. Pushing 2 Pushing 4 Pushing 6 The size of the stack is 3 Popping 6 Popping 4 Popping 2 KX KY