#include<iostream>
#include<cstdlib>
using namespace std;
class stack
{
public:
int top=-1;
int s=10,a[20];
void push(int d);
int pop();
};
void stack::push(int d)
{
if(top>s-2)
cout<<"stack is full";
else
a[++top]=d;
}
int stack::pop()
{int c;
if(top<=-1){
cout<<"empty";
return 0;}
else
return (a[top]);
}
int main()
{
stack s;
int i=0;
char c[10];
cout<<"enter the infix expression";
cin.getline(c,10);
while(c[i]!='\0')
{
}}
#include<cstdlib>
using namespace std;
class stack
{
public:
int top=-1;
int s=10,a[20];
void push(int d);
int pop();
};
void stack::push(int d)
{
if(top>s-2)
cout<<"stack is full";
else
a[++top]=d;
}
int stack::pop()
{int c;
if(top<=-1){
cout<<"empty";
return 0;}
else
return (a[top]);
}
int main()
{
stack s;
int i=0;
char c[10];
cout<<"enter the infix expression";
cin.getline(c,10);
while(c[i]!='\0')
{
}}
No comments:
Post a Comment