1 Write a Program in C++ for POP and PUSH operation
Answers
Answered by
1
Answer:
void push(int val) { if(top>=n-1) cout<<"Stack Overflow"<<endl; else { top++; stack[top]=val; } } ...
void pop() { if(top<=-1) cout<<"Stack Underflow"<<endl; else { cout<<"The popped element is "<< stack[top] <<endl; top--; } }
Similar questions
India Languages,
1 month ago
Hindi,
1 month ago
Biology,
3 months ago
Social Sciences,
3 months ago
Science,
9 months ago