<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>stack push | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/stack-push/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Sat, 09 Jun 2012 11:16:34 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>
	<item>
		<title>C program to implement stack operations using array</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-to-implement-stack-operations-using-array/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-to-implement-stack-operations-using-array/#comments</comments>
		
		<dc:creator><![CDATA[Drithi]]></dc:creator>
		<pubDate>Tue, 05 Jun 2012 09:18:42 +0000</pubDate>
				<category><![CDATA[Data Structures]]></category>
		<category><![CDATA[stack]]></category>
		<category><![CDATA[stack operations]]></category>
		<category><![CDATA[stack push]]></category>
		<category><![CDATA[stack pop]]></category>
		<category><![CDATA[stack overflow]]></category>
		<category><![CDATA[stack underflow]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=3126</guid>

					<description><![CDATA[<p>Below is the C program to implement stack operations using array #include #include #include #define size 100 int top=-1; int flag=0; int stack[size]; void push(int *,int); int pop(int *); void display(int *); void push(int s[],int d) { if(top==(size-1)) flag=0; else { flag=1; ++top; s[top]=d; } } int pop(int s[]) { int popped_element; if(top==-1) { popped_element=0;</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-to-implement-stack-operations-using-array/">C program to implement stack operations using array</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Below is the C program to implement stack operations using array</p>
<pre lang="c" line="1">
#include<stdio.h>
#include<string.h>
#include<ctype.h>
#define size 100
int top=-1;
int flag=0;
int stack[size];
void push(int *,int);
int pop(int *);
void display(int *);
void push(int s[],int d)
{
    if(top==(size-1))
        flag=0;
    else
    {
        flag=1;
        ++top;
        s[top]=d;
    }
}
int pop(int s[])
{
    int popped_element;
    if(top==-1)
    {
        popped_element=0;
        flag=0;
    }
    else
    {
        flag=1;
        popped_element=s[top];
        --top;
    }
    return(popped_element);
}
void display(int s[])
{
    int i;
    if(top==-1)
    {
        printf("\n stack is empty");
    }
    else
    {
        for(i=top;i>=0;--i)
            printf("\n %d",s[i]);
    }
}
/* this is the main function */
void main()
{
    int data;
    char choice;
    int q=0;
    int top=-1;
    clrscr();
    do
    {
        printf("\n push->i pop->p quit->q:");
        printf("enter your choice");
        do
        {
            choice=getchar();
            choice=tolower(choice);
        }
        while(strchr("ipq",choice)==NULL);
        printf("your choice is %c",choice);
        switch(choice)
        {
        case'i':printf("\n input element to push");
            scanf("%d",&data);
            push(stack,data);
            if(flag)
            {
                printf("\n after inserting ");
                display(stack);
                if(top==(size-1))
                    printf("\n stack is full");
            }
            else
                printf("\n stack is overflown after pushing");
            break;
        case 'p':data=pop(stack);
            if(flag)
            {
                printf("\n data is popped:%d",data);
                printf("\n now the stack is as follows :\n");
                display(stack);
            }
            else
                printf("\n stack is underflown");
            break;
        case'q':q=1;
        }
    }
    while(!q);
}
</pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-to-implement-stack-operations-using-array/">C program to implement stack operations using array</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-to-implement-stack-operations-using-array/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>C Program which performs stack operations</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-which-performs-stack-operations/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-which-performs-stack-operations/#comments</comments>
		
		<dc:creator><![CDATA[Drithi]]></dc:creator>
		<pubDate>Tue, 05 Jun 2012 08:49:00 +0000</pubDate>
				<category><![CDATA[Advanced programs]]></category>
		<category><![CDATA[c programs]]></category>
		<category><![CDATA[stack]]></category>
		<category><![CDATA[stack operations]]></category>
		<category><![CDATA[stack push]]></category>
		<category><![CDATA[stack pop]]></category>
		<category><![CDATA[data structures]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=3121</guid>

					<description><![CDATA[<p>Following program performs various stack operations,   #include #include #include #include #define max 20 int top=-1,s[max]; void push(int n) { if(top==max-1) { puts("stack is over flown"); return; } else { top=top+1; s[top]=n; } } void pop() { int del; if(top==-1) { puts("stack is underflown"); return; } else { del=s[top]; printf("\n poped element is %d",del); top=top-1;</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-which-performs-stack-operations/">C Program which performs stack operations</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Following program performs various stack operations,</p>
<pre lang="c" line="1"> 
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<string.h>
#define max 20

int top=-1,s[max];
void push(int n)
{
    if(top==max-1)
    {
        puts("stack is over flown");
        return;
    }
    else
    {
        top=top+1;
        s[top]=n;
    }
}
void pop()
{
    int del;
    if(top==-1)
    {
        puts("stack is underflown");
        return;
    }
    else
    {
        del=s[top];
        printf("\n poped element is %d",del);
        top=top-1;
    }
}
void display()
{
    int i;
    if(top==-1)
        puts("stack is empty");
    else
    {
        for(i=top;i>=0;i--)
            printf("\t%d",s[i]);
    }
}
void main()
{
    int opt,n;
    do
    {
        printf("\n 1.push");
        printf("\n 2.pop");
        printf("\n 3.display");
        printf("\n 4.exit");
        printf("enter ur option");
        scanf("%d",&opt);
        switch(opt)
        {
        case1:printf("\n enter any element to push");
            scanf("%d",&n);
            break;
        case2:pop();
            break;
        case3:display();
            break;
        case4:exit(0);
            break;
        }
    }
    while(1);
}
</pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-which-performs-stack-operations/">C Program which performs stack operations</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-which-performs-stack-operations/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
