<?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 operations | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/stack-operations/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 16:47:33 +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 Linked Lists</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-to-implement-stack-operations-using-linked-lists/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-to-implement-stack-operations-using-linked-lists/#comments</comments>
		
		<dc:creator><![CDATA[Ansten Lobo]]></dc:creator>
		<pubDate>Sat, 09 Jun 2012 16:47:33 +0000</pubDate>
				<category><![CDATA[Data Structures]]></category>
		<category><![CDATA[stack operations]]></category>
		<category><![CDATA[Linked Lists]]></category>
		<category><![CDATA[c program]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=3311</guid>

					<description><![CDATA[<p>C Program to implement STACK operations using Linked Lists. Source: Dr. G T Raju, Professor &#038; Head, Dept. of CSE, RNSIT #include typedef struct node { int data; struct node *link; }NODE; void Push(int); int pop(); void Display(); NODE *top=NULL; /* Global Declarations */ main() { /* Main Program */ int opn,elem; do { clrscr();</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-to-implement-stack-operations-using-linked-lists/">C Program to implement STACK operations using Linked Lists</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>C Program to implement STACK operations using Linked Lists.<br />
Source: Dr. G T Raju, Professor &#038; Head, Dept. of CSE, RNSIT</p>
<pre lang="C" line="1">
#include <stdlib.h>
typedef struct node
{
    int data;
    struct node *link;
}NODE;

void Push(int);
int  pop();
void Display();
NODE *top=NULL;   /* Global Declarations */

main()
{
    /* Main Program */
    int opn,elem;
    do
    {
        clrscr();
        printf("\n ### Linked List Implementation of STACK Operations ### \n\n");
        printf("\n Press 1-Push, 2-Pop, 3-Display,4-Exit\n");
        printf("\n Your option ? ");
        scanf("%d",&opn);
        switch(opn)
        {
        case 1:
            printf("\n\nRead the Element tobe pushed ?");
            scanf("%d",&elem);
            Push(elem);
            break;
        case 2:
            elem=Pop();
            if(elem != -1)
                printf(" Deleted Node(From Top)with the Data: %d\n",elem);
            break;
        case 3: printf("Linked List Implementation of Stack: Status:\n");
            Display(); break;
        case 4: printf("\n\n Terminating \n\n"); break;
        default: printf("\n\nInvalid Option !!! Try Again !! \n\n");
            break;
        }
        printf("\n\n\n\n  Press a Key to Continue . . . ");
        getch();
    }while(opn != 4);
}

void Push(int info)
{
    NODE *temp;
    temp=(NODE *)malloc(sizeof(NODE));
    if( temp == NULL)
        printf(" Out of Memory !! Overflow !!!");
    else
    {
        temp->data=info;
        temp->link=top;
        top=temp;
        printf(" Node has been inserted at Top(Front) Successfully !!");
    }
}

int Pop()
{
    int info;
    NODE *t;
    if( top ==  NULL) { printf(" Underflow!!!"); return -1; }
    else
    {
        t=top;
        info=top->data;
        top=top->link;
        t->link=NULL;
        free(t);
        return(info);
    }
}

void Display()
{
    NODE *t;
    if( top == NULL) printf("Empty Stack\n");
    else
    {
        t=top;
        printf("Top->");
        while(t)
        {
            printf("[%d]->",t->data);
            t=t->link;
        }
        printf("Null\n");
    }
}
</pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-to-implement-stack-operations-using-linked-lists/">C Program to implement STACK operations using Linked Lists</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-linked-lists/feed/</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
		<item>
		<title>C Program for Stack Operations – Using Array</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-for-stack-operations-using-array/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-for-stack-operations-using-array/#respond</comments>
		
		<dc:creator><![CDATA[Ansten Lobo]]></dc:creator>
		<pubDate>Sat, 09 Jun 2012 16:19:59 +0000</pubDate>
				<category><![CDATA[Data Structures]]></category>
		<category><![CDATA[using array]]></category>
		<category><![CDATA[stack operations]]></category>
		<category><![CDATA[c program]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=3297</guid>

					<description><![CDATA[<p>Source: Dr. G T Raju, Professor &#038; Head, Dept. of CSE, RNSIT #define SIZE 5 /* Size of Stack */ int s[SIZE],top=-1; /* Global declarations */ push(int elem) { /* Function for PUSH operation */ if( Sfull()) printf("\n\n Overflow!!!!\n\n"); else { ++top; s[top]=elem; } } int pop() { /* Function for POP operation */ int</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-for-stack-operations-using-array/">C Program for Stack Operations – Using Array</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Source: Dr. G T Raju, Professor &#038; Head, Dept. of CSE, RNSIT</p>
<pre lang="C" line="1">
#define SIZE 5            /* Size of Stack */
int s[SIZE],top=-1;       /* Global declarations */

push(int elem)
{                       /* Function for PUSH operation */
    if( Sfull()) printf("\n\n Overflow!!!!\n\n");
    else
    {
        ++top;
        s[top]=elem;
    }
}

int pop()
{                      /* Function for POP operation */
    int elem;
    if(Sempty()){ printf("\n\nUnderflow!!!!\n\n");
    return(-1); }
    else
    {
        elem=s[top];
        top--;
        return(elem);
    }
}

int Sfull()
{                     /* Function to Check Stack Full */
    if(top == SIZE-1) return 1;
    return 0;
}

int Sempty()
{                    /* Function to Check Stack Empty */
    if(top == -1) return 1;
    return 0;
}

display()
{                  /* Function to display status of Stack */
    int i;
    if(Sempty()) printf(" \n Empty Stack\n");
    else
    {
        for(i=0;i<=top;i++)
            printf("%d\n",s[i]);
        printf("^Top");
    }
}

main()
{                         /* Main Program */
    int opn,elem;
    do
    {
        clrscr();
        printf("\n ### Stack Operations ### \n\n");
        printf("\n Press 1-Push, 2-Pop,3-Display,4-Exit\n");
        printf("\n Your option ? ");
        scanf("%d",&#038;opn);
        switch(opn)
        {
        case 1: printf("\n\nRead the element to be pushed ?");
            scanf("%d",&#038;elem);
            push(elem); break;
        case 2: elem=pop();
            if( elem != -1)
                printf("\n\nPopped Element is %d \n",elem);
            break;
        case 3: printf("\n\nStatus of Stack\n\n");
            display(); break;
        case 4: printf("\n\n Terminating \n\n"); break;
        default: printf("\n\nInvalid Option !!! Try Again !! \n\n");
            break;
        }
        printf("\n\n\n\n  Press a Key to Continue . . . ");
        getch();
    }while(opn != 4);
}
</pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-for-stack-operations-using-array/">C Program for 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-for-stack-operations-using-array/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<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 underflow]]></category>
		<category><![CDATA[stack overflow]]></category>
		<category><![CDATA[stack pop]]></category>
		<category><![CDATA[stack push]]></category>
		<category><![CDATA[stack operations]]></category>
		<category><![CDATA[stack]]></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[stack]]></category>
		<category><![CDATA[data structures]]></category>
		<category><![CDATA[stack pop]]></category>
		<category><![CDATA[stack push]]></category>
		<category><![CDATA[stack operations]]></category>
		<category><![CDATA[c programs]]></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>
