Open muhtalhakhan opened 1 year ago
hey @muhtalhakhan can u assign this issue to me .This is my code in c and I can write this code in java also.
int top=-1;
int stack[n];
void push();
void pop();
void peek();
void display();
int main()
{
int c,k;
while(1){
printf(" 1:push\n 2:pop\n 3: peek\n 4: display\n Enter your choice: ");
scanf("%d",&c);
switch(c){
case 1: push();
break;
case 2: pop();
break;
case 3: peek();
break;
case 4:display();
break;
default: printf("Invalid input");
}
printf("Enter 1 to continue:");
scanf("%d",&k);
if(k==0){
break;
}
} } void push() { int x; printf("enter data:"); scanf("%d",&x); if(top==n-1) printf("stack overflow\n"); else { top++; stack[top]=x; } } void pop(){ // int k; if(top==-1) printf("stack underflow\n"); else {
printf(" popped out element is: %d\n ",stack[top]);
//stack[top]=k; top--;
}
} void peek(){ if(top==-1) printf("stack is empty\n"); else{ printf(" peek element is : %d\n",stack[top]); top--; } } void display(){ if(top==-1) printf("stack is empty\n"); else{ for(int i=top;i>=0;i--) printf(" display elements are: %d\n",stack[i]); } }
Hey, I've worked on this. Can you assign this to me!
is anyone working or can you assign this to me , i can provide you some good java problems
@muhtalhakhan can you assign this issue to me?
multiple programs are welcomed
Hey, I'm working on this program. Please assign this issue to me!