76 285
Assignments Done
Successfully Done
In May 2019

Answer to Question #22654 in C++ for rodea embradura

Question #22654
create a program that will perform the following task:
-pop(s) { remove an item/element from the top of stack }
-push(s,i) { to add an element to the top of the stack }
-empty(s) { determine if the stack is empty or not }
-stack top(s) { determine the top element of the stack }
Expert's answer
#include <iostream>
using namespace std;
class stack{
int m[100];
int head;
void push(int a){
m[head] = a;
bool pop(){
if (head >= 0){
return true;
else return false;
bool empty(){
if (head >= 0 ) return true;
else return false;
int stackTop(){return m[head];}

int main(){

return 0;

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions