<?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>c program | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/c-program/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Tue, 03 Jun 2014 08:36: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>What are C Tokens?</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c-faq/what-are-c-tokens/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c-faq/what-are-c-tokens/#respond</comments>
		
		<dc:creator><![CDATA[Chitra]]></dc:creator>
		<pubDate>Tue, 03 Jun 2014 08:33:18 +0000</pubDate>
				<category><![CDATA[C Questions & Answers]]></category>
		<category><![CDATA[c program]]></category>
		<category><![CDATA[c programs]]></category>
		<category><![CDATA[variables]]></category>
		<category><![CDATA[c language]]></category>
		<category><![CDATA[operators]]></category>
		<category><![CDATA[keywords]]></category>
		<category><![CDATA[special characters]]></category>
		<category><![CDATA[constants]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=5397</guid>

					<description><![CDATA[<p>C programs contains many elements which are identified by the compiler as Tokens. Tokens can be categorized as 1. Keywords2. Variables3. Constants 4. Special characters 5. Operators C Token example program: int main() { int x, y, sum; x = 5, y = 10; sum = x + y; Printf (“Sum = %d \n”, sum);</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/what-are-c-tokens/">What are C Tokens?</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>C programs contains many elements which are identified by the compiler as Tokens. <br />Tokens can be categorized as <br />1. Keywords<br />2. Variables<br />3. Constants <br />4. Special characters <br />5. Operators</p>
<p>C Token example program:</p>
<pre lang="c" escaped="true">
int main()
{
 int x, y, sum;
 x = 5, y = 10;
 sum = x + y;
 Printf (“Sum = %d \n”, sum);
}</pre>
<p>From above program C Tokens can be categorized as follows,<br />main &#8211; identifier, which is usually used by linker as the entry point of the regular program<br />{,}, (,) – delimiter<br />int – keyword<br />x, y, sum – Variables<br />+, = &#8211; Operators<br />main, {, }, (, ), int, x, y, sum – tokens</p><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c-faq/what-are-c-tokens/">What are C Tokens?</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-faq/what-are-c-tokens/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>C Program for implementing two Stacks on Single Array</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-for-implementing-two-stacks-on-single-array/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-for-implementing-two-stacks-on-single-array/#comments</comments>
		
		<dc:creator><![CDATA[Ansten Lobo]]></dc:creator>
		<pubDate>Sat, 09 Jun 2012 17:08:14 +0000</pubDate>
				<category><![CDATA[Data Structures]]></category>
		<category><![CDATA[c program]]></category>
		<category><![CDATA[Stacks using array]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=3336</guid>

					<description><![CDATA[<p>C Program for implementing two Stacks on Single Array. Source: Dr. G T Raju, Professor &#038; Head, Dept. of CSE, RNSIT #define SIZE 10 /* Size of Stack */ int s[SIZE],top[3]={0,-1,SIZE}; /* Global declarations */ push(int elem,int stno) { int pos; /* Function for PUSH operation */ if( Sfull()) printf("\n\n Overflow!!!!\n\n"); else { if(stno==1) pos=</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-for-implementing-two-stacks-on-single-array/">C Program for implementing two Stacks on Single Array</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>C Program for implementing two Stacks on Single Array.<br />
Source: Dr. G T Raju, Professor &#038; Head, Dept. of CSE, RNSIT</p>
<pre lang="C" line="1">
#define SIZE 10            /* Size of Stack */
int s[SIZE],top[3]={0,-1,SIZE};
/* Global declarations */
push(int elem,int stno)
{
    int pos;	     /* Function for PUSH operation */
    if( Sfull()) printf("\n\n Overflow!!!!\n\n");
    else
    {
        if(stno==1) pos= ++top[stno];
        else pos=--top[stno];
        s[pos]=elem;
    }
}

int pop(int stno)
{                      /* Function for POP operation */
    int elem,pos;
    if(Sempty(stno)){ printf("\n\nUnderflow!!!!\n\n");
    return(-1); }
    else
    {
        pos=top[stno];
        elem=s[pos];
        if(stno == 1)top[stno]--;
        else
            top[stno]++;
        return(elem);
    }
}

int Sfull()
{                     /* Function to Check Stack Full */
    if(top[1] == top[2]-1) return 1;
    return 0;
}

int Sempty(stno)
{
    /* Function to Check Stack Empty */
    switch(stno)
    {
    case 1: if(top[1] == -1) return 1; else return 0;
    case 2: if(top[2] == SIZE) return 1;else return 0;
    }
}

display(int stno)
{                  /* Function to display status of Stack */
    int i;
    if(Sempty(stno)) printf(" \n Empty Stack\n");
    else
    {
        if(stno == 1)
        {
            for(i=0;i<=top[stno];i++)
                printf("%d\n",s[i]);
            printf("^Top");
        }
        else
        {
            for(i=SIZE-1;i>=top[stno];i--)
                printf("%d\n",s[i]);
            printf("^Top");
        }
    }
}

main()
{                         /* Main Program */
    int opn,elem,stno;
    do
    {
        clrscr();
        printf("\n ### Stack Operations ### \n\n");
        printf("\n Stack Number (1,2): ");
        scanf("%d",&stno);
        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 to be pushed ?");
            scanf("%d",&elem);
            push(elem,stno); break;
        case 2: elem=pop(stno);
            if( elem != -1)
                printf("\n\nPopped Element is %d \n",elem);
            break;
        case 3: printf("\n\nStatus of Stack %d \n\n",stno);
            display(stno); 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-implementing-two-stacks-on-single-array/">C Program for implementing two Stacks on Single 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-implementing-two-stacks-on-single-array/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>C Program for Simple DSC order Priority QUEUE Implementation using Structure</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-for-simple-dsc-order-priority-queue-implementation-using-structure/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-for-simple-dsc-order-priority-queue-implementation-using-structure/#respond</comments>
		
		<dc:creator><![CDATA[Ansten Lobo]]></dc:creator>
		<pubDate>Sat, 09 Jun 2012 17:06:15 +0000</pubDate>
				<category><![CDATA[Data Structures]]></category>
		<category><![CDATA[c program]]></category>
		<category><![CDATA[Priority QUEUE]]></category>
		<category><![CDATA[C Structure]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=3333</guid>

					<description><![CDATA[<p>C Program for Simple DSC order Priority QUEUE Implementation using Structure. Source: Dr. G T Raju, Professor &#038; Head, Dept. of CSE, RNSIT. #define SIZE 5 /* Size of Queue */ int f=0,r=-1; /* Global declarations */ typedef struct PRQ { int ele; int pr; }PriorityQ; PriorityQ PQ[SIZE]; PQinsert(int elem, int pre) { int i;</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-for-simple-dsc-order-priority-queue-implementation-using-structure/">C Program for Simple DSC order Priority QUEUE Implementation using Structure</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>C Program for Simple DSC order Priority QUEUE Implementation using Structure.<br />
Source: Dr. G T Raju, Professor &#038; Head, Dept. of CSE, RNSIT.</p>
<pre lang="C" line="1">
#define SIZE 5            /* Size of Queue */
int f=0,r=-1;       /* Global declarations */
typedef struct PRQ
{
    int ele;
    int pr;
}PriorityQ;

PriorityQ PQ[SIZE];

PQinsert(int elem, int pre)
{
    int i;       /* Function for Insert operation */
    if( Qfull()) printf("\n\n Overflow!!!!\n\n");
    else
    {
        i=r;
        ++r;
        while(PQ[i].pr <= pre &#038;&#038; i >= 0) /* Find location for new elem */
        {
            PQ[i+1]=PQ[i];
            i--;
        }
        PQ[i+1].ele=elem;
        PQ[i+1].pr=pre;
    }
}

PriorityQ PQdelete()
{                      /* Function for Delete operation */
    PriorityQ p;
    if(Qempty()){ printf("\n\nUnderflow!!!!\n\n");
    p.ele=-1;p.pr=-1;
    return(p); }
    else
    {
        p=PQ[f];
        f=f+1;
        return(p);
    }
}

int Qfull()
{                     /* Function to Check Queue Full */
    if(r==SIZE-1) return 1;
    return 0;
}

int Qempty()
{                    /* Function to Check Queue Empty */
    if(f > r) return 1;
    return 0;
}

display()
{                  /* Function to display status of Queue */
    int i;
    if(Qempty()) printf(" \n Empty Queue\n");
    else
    {
        printf("Front->");
        for(i=f;i<=r;i++)
            printf("[%d,%d] ",PQ[i].ele,PQ[i].pr);
        printf("<-Rear");
    }
}

main()
{                         /* Main Program */
    int opn;
    PriorityQ p;
    do
    {
        clrscr();
        printf("\n ### Priority Queue Operations(DSC order) ### \n\n");
        printf("\n Press 1-Insert, 2-Delete,3-Display,4-Exit\n");
        printf("\n Your option ? ");
        scanf("%d",&#038;opn);
        switch(opn)
        {
        case 1: printf("\n\nRead the element and its Priority?");
            scanf("%d%d",&#038;p.ele,&#038;p.pr);
            PQinsert(p.ele,p.pr); break;
        case 2: p=PQdelete();
            if( p.ele != -1)
                printf("\n\nDeleted Element is %d \n",p.ele);
            break;
        case 3: printf("\n\nStatus of Queue\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-simple-dsc-order-priority-queue-implementation-using-structure/">C Program for Simple DSC order Priority QUEUE Implementation using Structure</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-simple-dsc-order-priority-queue-implementation-using-structure/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>C Program for Simple ASC order Priority QUEUE Implementation using Structure</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-for-simple-asc-order-priority-queue-implementation-using-structure/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-for-simple-asc-order-priority-queue-implementation-using-structure/#respond</comments>
		
		<dc:creator><![CDATA[Ansten Lobo]]></dc:creator>
		<pubDate>Sat, 09 Jun 2012 17:04:28 +0000</pubDate>
				<category><![CDATA[Data Structures]]></category>
		<category><![CDATA[c program]]></category>
		<category><![CDATA[C Structure]]></category>
		<category><![CDATA[c Queue]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=3331</guid>

					<description><![CDATA[<p>C Program for Simple ASC order Priority QUEUE Implementation using Structure. Source: Dr. G T Raju, Professor &#038; Head, Dept. of CSE, RNSIT #define SIZE 5 /* Size of Queue */ int f=0,r=-1; /* Global declarations */ typedef struct PRQ { int ele; int pr; }PriorityQ; PriorityQ PQ[SIZE]; PQinsert(int elem, int pre) { int i;</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-for-simple-asc-order-priority-queue-implementation-using-structure/">C Program for Simple ASC order Priority QUEUE Implementation using Structure</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>C Program for Simple ASC order Priority QUEUE Implementation using Structure.<br />
Source: Dr. G T Raju, Professor &#038; Head, Dept. of CSE, RNSIT</p>
<pre lang="C" line="1">
#define SIZE 5            /* Size of Queue */
int f=0,r=-1;       /* Global declarations */
typedef struct PRQ
{
    int ele;
    int pr;
}PriorityQ;

PriorityQ PQ[SIZE];

PQinsert(int elem, int pre)
{
    int i;       /* Function for Insert operation */
    if( Qfull()) printf("\n\n Overflow!!!!\n\n");
    else
    {
        i=r;
        ++r;
        while(PQ[i].pr >= pre && i >= 0) /* Find location for new elem */
        {
            PQ[i+1]=PQ[i];
            i--;
        }
        PQ[i+1].ele=elem;
        PQ[i+1].pr=pre;
    }
}

PriorityQ PQdelete()
{                      /* Function for Delete operation */
    PriorityQ p;
    if(Qempty()){ printf("\n\nUnderflow!!!!\n\n");
    p.ele=-1;p.pr=-1;
    return(p); }
    else
    {
        p=PQ[f];
        f=f+1;
        return(p);
    }
}
int Qfull()
{                     /* Function to Check Queue Full */
    if(r==SIZE-1) return 1;
    return 0;
}

int Qempty()
{                    /* Function to Check Queue Empty */
    if(f > r) return 1;
    return 0;
}

display()
{                  /* Function to display status of Queue */
    int i;
    if(Qempty()) printf(" \n Empty Queue\n");
    else
    {
        printf("Front->");
        for(i=f;i<=r;i++)
            printf("[%d,%d] ",PQ[i].ele,PQ[i].pr);
        printf("<-Rear");
    }
}

main()
{                         /* Main Program */
    int opn;
    PriorityQ p;
    do
    {
        clrscr();
        printf("\n ### Priority Queue Operations(DSC order) ### \n\n");
        printf("\n Press 1-Insert, 2-Delete,3-Display,4-Exit\n");
        printf("\n Your option ? ");
        scanf("%d",&#038;opn);
        switch(opn)
        {
        case 1: printf("\n\nRead the element and its Priority?");
            scanf("%d%d",&#038;p.ele,&#038;p.pr);
            PQinsert(p.ele,p.pr); break;
        case 2: p=PQdelete();
            if( p.ele != -1)
                printf("\n\nDeleted Element is %d \n",p.ele);
            break;
        case 3: printf("\n\nStatus of Queue\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-simple-asc-order-priority-queue-implementation-using-structure/">C Program for Simple ASC order Priority QUEUE Implementation using Structure</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-simple-asc-order-priority-queue-implementation-using-structure/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>C Program for Simple DSC order Priority QUEUE Implementation</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-for-simple-dsc-order-priority-queue-implementation/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-for-simple-dsc-order-priority-queue-implementation/#respond</comments>
		
		<dc:creator><![CDATA[Ansten Lobo]]></dc:creator>
		<pubDate>Sat, 09 Jun 2012 17:03:07 +0000</pubDate>
				<category><![CDATA[Data Structures]]></category>
		<category><![CDATA[c program]]></category>
		<category><![CDATA[QUEUE Implementation]]></category>
		<category><![CDATA[DSC order Priority QUEUE]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=3329</guid>

					<description><![CDATA[<p>C Program for Simple DSC order Priority QUEUE Implementation. Source: Dr. G T Raju, Professor &#038; Head, Dept. of CSE, RNSIT #define SIZE 5 /* Size of Queue */ int PQ[SIZE],f=0,r=-1; /* Global declarations */ PQinsert(int elem) { int i; /* Function for Insert operation */ if( Qfull()) printf("\n\n Overflow!!!!\n\n"); else { i=r; ++r; while(PQ[i]</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-for-simple-dsc-order-priority-queue-implementation/">C Program for Simple DSC order Priority QUEUE Implementation</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>C Program for Simple DSC order Priority QUEUE Implementation.<br />
Source: Dr. G T Raju, Professor &#038; Head, Dept. of CSE, RNSIT</p>
<pre lang="C" line="1">
#define SIZE 5            /* Size of Queue */
int PQ[SIZE],f=0,r=-1;       /* Global declarations */

PQinsert(int elem)
{
    int i;       /* Function for Insert operation */
    if( Qfull()) printf("\n\n Overflow!!!!\n\n");
    else
    {
        i=r;
        ++r;
        while(PQ[i] <= elem &#038;&#038; i >= 0) /* Find location for new elem */
        {
            PQ[i+1]=PQ[i];
            i--;
        }
        PQ[i+1]=elem;
    }
}

int PQdelete()
{                      /* Function for Delete operation */
    int elem;
    if(Qempty()){ printf("\n\nUnderflow!!!!\n\n");
    return(-1); }
    else
    {
        elem=PQ[f];
        f=f+1;
        return(elem);
    }
}

int Qfull()
{                     /* Function to Check Queue Full */
    if(r==SIZE-1) return 1;
    return 0;
}

int Qempty()
{                    /* Function to Check Queue Empty */
    if(f > r) return 1;
    return 0;
}

display()
{                  /* Function to display status of Queue */
    int i;
    if(Qempty()) printf(" \n Empty Queue\n");
    else
    {
        printf("Front->");
        for(i=f;i<=r;i++)
            printf("%d ",PQ[i]);
        printf("<-Rear");
    }
}

main()
{                         /* Main Program */
    int opn,elem;
    do
    {
        clrscr();
        printf("\n ### Priority Queue Operations(DSC order) ### \n\n");
        printf("\n Press 1-Insert, 2-Delete,3-Display,4-Exit\n");
        printf("\n Your option ? ");
        scanf("%d",&#038;opn);
        switch(opn)
        {
        case 1: printf("\n\nRead the element to be Inserted ?");
            scanf("%d",&#038;elem);
            PQinsert(elem); break;
        case 2: elem=PQdelete();
            if( elem != -1)
                printf("\n\nDeleted Element is %d \n",elem);
            break;
        case 3: printf("\n\nStatus of Queue\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-simple-dsc-order-priority-queue-implementation/">C Program for Simple DSC order Priority QUEUE Implementation</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-simple-dsc-order-priority-queue-implementation/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>C Program for Simple ASC order Priority QUEUE Implementation</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-for-simple-asc-order-priority-queue-implementation/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-for-simple-asc-order-priority-queue-implementation/#comments</comments>
		
		<dc:creator><![CDATA[Ansten Lobo]]></dc:creator>
		<pubDate>Sat, 09 Jun 2012 17:01:54 +0000</pubDate>
				<category><![CDATA[Data Structures]]></category>
		<category><![CDATA[QUEUE Implementation]]></category>
		<category><![CDATA[c program]]></category>
		<category><![CDATA[Priority QUEUE]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=3327</guid>

					<description><![CDATA[<p>C Program for Simple ASC order Priority QUEUE Implementation. Source: Dr. G T Raju, Professor &#038; Head, Dept. of CSE, RNSIT #define SIZE 5 /* Size of Queue */ int PQ[SIZE],f=0,r=-1; /* Global declarations */ PQinsert(int elem) { int i; /* Function for Insert operation */ if( Qfull()) printf("\n\n Overflow!!!!\n\n"); else { i=r; ++r; while(PQ[i]</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-for-simple-asc-order-priority-queue-implementation/">C Program for Simple ASC order Priority QUEUE Implementation</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>C Program for Simple ASC order Priority QUEUE Implementation.<br />
Source: Dr. G T Raju, Professor &#038; Head, Dept. of CSE, RNSIT</p>
<pre lang="C" line="1">
#define SIZE 5            /* Size of Queue */
int PQ[SIZE],f=0,r=-1;       /* Global declarations */

PQinsert(int elem)
{
    int i;       /* Function for Insert operation */
    if( Qfull()) printf("\n\n Overflow!!!!\n\n");
    else
    {
        i=r;
        ++r;
        while(PQ[i] >= elem && i >= 0) /* Find location for new elem */
        {
            PQ[i+1]=PQ[i];
            i--;
        }
        PQ[i+1]=elem;
    }
}

int PQdelete()
{                      /* Function for Delete operation */
    int elem;
    if(Qempty()){ printf("\n\nUnderflow!!!!\n\n");
    return(-1); }
    else
    {
        elem=PQ[f];
        f=f+1;
        return(elem);
    }
}

int Qfull()
{                     /* Function to Check Queue Full */
    if(r==SIZE-1) return 1;
    return 0;
}

int Qempty()
{                    /* Function to Check Queue Empty */
    if(f > r) return 1;
    return 0;
}

display()
{                  /* Function to display status of Queue */
    int i;
    if(Qempty()) printf(" \n Empty Queue\n");
    else
    {
        printf("Front->");
        for(i=f;i<=r;i++)
            printf("%d ",PQ[i]);
        printf("<-Rear");
    }
}

main()
{                         /* Main Program */
    int opn,elem;
    do
    {
        clrscr();
        printf("\n ### Priority Queue Operations(ASC order) ### \n\n");
        printf("\n Press 1-Insert, 2-Delete,3-Display,4-Exit\n");
        printf("\n Your option ? ");
        scanf("%d",&#038;opn);
        switch(opn)
        {
        case 1: printf("\n\nRead the element to be Inserted ?");
            scanf("%d",&#038;elem);
            PQinsert(elem); break;
        case 2: elem=PQdelete();
            if( elem != -1)
                printf("\n\nDeleted Element is %d \n",elem);
            break;
        case 3: printf("\n\nStatus of Queue\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-simple-asc-order-priority-queue-implementation/">C Program for Simple ASC order Priority QUEUE Implementation</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-simple-asc-order-priority-queue-implementation/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>C Program to convert Prefix Expression into Postfix</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-to-convert-prefix-expression-into-postfix/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-to-convert-prefix-expression-into-postfix/#comments</comments>
		
		<dc:creator><![CDATA[Ansten Lobo]]></dc:creator>
		<pubDate>Sat, 09 Jun 2012 17:00:21 +0000</pubDate>
				<category><![CDATA[Data Structures]]></category>
		<category><![CDATA[c program]]></category>
		<category><![CDATA[Prefix to Postfix]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=3325</guid>

					<description><![CDATA[<p>C Program to convert Prefix Expression into Postfix . Source: Dr. G T Raju, Professor &#038; Head, Dept. of CSE, RNSIT #include #include char opnds[50][80],oprs[50]; int topr=-1,topd=-1; pushd(char *opnd) { strcpy(opnds[++topd],opnd); } char *popd() { return(opnds[topd--]); } pushr(char opr) { oprs[++topr]=opr; } char popr() { return(oprs[topr--]); } int empty(int t) { if( t == 0)</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-to-convert-prefix-expression-into-postfix/">C Program to convert Prefix Expression into Postfix</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>C Program to convert Prefix Expression into Postfix .<br />
Source: Dr. G T Raju, Professor &#038; Head, Dept. of CSE, RNSIT</p>
<pre lang="C" line="1">
#include <string.h>
#include <ctype.h>
char opnds[50][80],oprs[50];
int  topr=-1,topd=-1;
pushd(char *opnd)
{
    strcpy(opnds[++topd],opnd);
}
char *popd()
{
    return(opnds[topd--]);
}

pushr(char opr)
{
    oprs[++topr]=opr;
}
char popr()
{
    return(oprs[topr--]);
}
int empty(int t)
{
    if( t == 0) return(1);
    return(0);
}

main()
{
    char prfx[50],ch,str[50],opnd1[50],opnd2[50],opr[2];
    int i=0,k=0,opndcnt=0;
    gets(prfx);
    printf(" Given Prefix Expression : %s\n",prfx);
    while( (ch=prfx[i++]) != '\0')
    {
        if(isalnum(ch))
        {
            str[0]=ch; str[1]='\0';
            pushd(str); opndcnt++;
            if(opndcnt >= 2)
            {
                strcpy(opnd2,popd());
                strcpy(opnd1,popd());
                strcpy(str,opnd1);
                strcat(str,opnd2);
                ch=popr();
                opr[0]=ch;opr[1]='\0';
                strcat(str,opr);
                pushd(str);
                opndcnt-=1;
            }
        }
        else
        {
            pushr(ch);
            if(opndcnt==1)opndcnt=0;  /* operator followed by single operand*/
        }
    }
    if(!empty(topd))
    {
        strcpy(opnd2,popd());
        strcpy(opnd1,popd());
        strcpy(str,opnd1);
        strcat(str,opnd2);
        ch=popr();
        opr[0]=ch;opr[1]='\0';
        strcat(str,opr);
        pushd(str);
    }
    printf(" Postfix Expression: ");
    puts(opnds[topd]);
}
</pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-to-convert-prefix-expression-into-postfix/">C Program to convert Prefix Expression into Postfix</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-convert-prefix-expression-into-postfix/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>C Program to convert Prefix Expression into INFIX</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-to-convert-prefix-expression-into-infix/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-to-convert-prefix-expression-into-infix/#comments</comments>
		
		<dc:creator><![CDATA[Ansten Lobo]]></dc:creator>
		<pubDate>Sat, 09 Jun 2012 16:58:41 +0000</pubDate>
				<category><![CDATA[Advanced programs]]></category>
		<category><![CDATA[C Programs]]></category>
		<category><![CDATA[c program]]></category>
		<category><![CDATA[Prefix into INFIX]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=3323</guid>

					<description><![CDATA[<p>C Program to convert Prefix Expression into INFIX. Source: Dr. G T Raju, Professor &#038; Head, Dept. of CSE, RNSIT #include #include char opnds[50][80],oprs[50]; int topr=-1,topd=-1; pushd(char *opnd) { strcpy(opnds[++topd],opnd); } char *popd() { return(opnds[topd--]); } pushr(char opr) { oprs[++topr]=opr; } char popr() { return(oprs[topr--]); } int empty(int t) { if( t == 0) return(1);</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-to-convert-prefix-expression-into-infix/">C Program to convert Prefix Expression into INFIX</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>C Program to convert Prefix Expression into INFIX.<br />
Source: Dr. G T Raju, Professor &#038; Head, Dept. of CSE, RNSIT</p>
<pre lang="C" line="1">
#include <string.h>
#include <ctype.h>
char opnds[50][80],oprs[50];
int  topr=-1,topd=-1;
pushd(char *opnd)
{
    strcpy(opnds[++topd],opnd);
}
char *popd()
{
    return(opnds[topd--]);
}

pushr(char opr)
{
    oprs[++topr]=opr;
}
char popr()
{
    return(oprs[topr--]);
}
int empty(int t)
{
    if( t == 0) return(1);
    return(0);
}

main()
{
    char prfx[50],ch,str[50],opnd1[50],opnd2[50],opr[2];
    int i=0,k=0,opndcnt=0;
    gets(prfx);
    printf(" Given Prefix Expression : %s\n",prfx);
    while( (ch=prfx[i++]) != '\0')
    {
        if(isalnum(ch))
        {
            str[0]=ch; str[1]='\0';
            pushd(str); opndcnt++;
            if(opndcnt >= 2)
            {
                strcpy(opnd2,popd());
                strcpy(opnd1,popd());
                strcpy(str,"(");
                strcat(str,opnd1);
                ch=popr();
                opr[0]=ch;opr[1]='\0';
                strcat(str,opr);
                strcat(str,opnd2);
                strcat(str,")");
                pushd(str);
                opndcnt-=1;
            }
        }
        else
        {
            pushr(ch);
            if(opndcnt==1)opndcnt=0;  /* operator followed by single operand*/
        }
    }
    if(!empty(topd))
    {
        strcpy(opnd2,popd());
        strcpy(opnd1,popd());
        strcpy(str,"(");
        strcat(str,opnd1);
        ch=popr();
        opr[0]=ch;opr[1]='\0';
        strcat(str,opr);
        strcat(str,opnd2);
        strcat(str,")");
        pushd(str);
    }
    printf(" Infix Expression: ");
    puts(opnds[topd]);
}
</pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-to-convert-prefix-expression-into-infix/">C Program to convert Prefix Expression into INFIX</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-to-convert-prefix-expression-into-infix/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>C Program for Infix to Prefix Conversion</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-for-infix-to-prefix-conversion/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-for-infix-to-prefix-conversion/#comments</comments>
		
		<dc:creator><![CDATA[Ansten Lobo]]></dc:creator>
		<pubDate>Sat, 09 Jun 2012 16:57:15 +0000</pubDate>
				<category><![CDATA[Data Structures]]></category>
		<category><![CDATA[c program]]></category>
		<category><![CDATA[Source Codes]]></category>
		<category><![CDATA[C Programs]]></category>
		<category><![CDATA[Infix to Prefix]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=3321</guid>

					<description><![CDATA[<p>C Program for Infix to Prefix Conversion. Source: Dr. G T Raju, Professor &#038; Head, Dept. of CSE, RNSIT #define SIZE 50 /* Size of Stack */ #include #include char s[SIZE]; int top=-1; /* Global declarations */ push(char elem) { /* Function for PUSH operation */ s[++top]=elem; } char pop() { /* Function for POP</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-for-infix-to-prefix-conversion/">C Program for Infix to Prefix Conversion</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>C Program for Infix to Prefix Conversion.<br />
Source: Dr. G T Raju, Professor &#038; Head, Dept. of CSE, RNSIT</p>
<pre lang="C" line="1">
#define SIZE 50            /* Size of Stack */
#include<string.h>
#include <ctype.h>
char s[SIZE];
int top=-1;       /* Global declarations */

push(char elem)
{                       /* Function for PUSH operation */
    s[++top]=elem;
}

char pop()
{                      /* Function for POP operation */
    return(s[top--]);
}

int pr(char elem)
{                 /* Function for precedence */
    switch(elem)
    {
    case '#': return 0;
    case ')': return 1;
    case '+':
    case '-': return 2;
    case '*':
    case '/': return 3;
    }
}

main()
{                         /* Main Program */
    char infx[50],prfx[50],ch,elem;
    int i=0,k=0;
    printf("\n\nRead the Infix Expression ? ");
    scanf("%s",infx);
    push('#');
    strrev(infx);
    while( (ch=infx[i++]) != '\0')
    {
        if( ch == ')') push(ch);
        else
            if(isalnum(ch)) prfx[k++]=ch;
            else
                if( ch == '(')
                {
                    while( s[top] != ')')
                        prfx[k++]=pop();
                    elem=pop(); /* Remove ) */
                }
                else
                {       /* Operator */
                    while( pr(s[top]) >= pr(ch) )
                        prfx[k++]=pop();
                    push(ch);
                }
    }
    while( s[top] != '#')     /* Pop from stack till empty */
        prfx[k++]=pop();
    prfx[k]='\0';          /* Make prfx as valid string */
    strrev(prfx);
    strrev(infx);
    printf("\n\nGiven Infix Expn: %s  Prefix Expn: %s\n",infx,prfx);
}
</pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-for-infix-to-prefix-conversion/">C Program for Infix to Prefix Conversion</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-infix-to-prefix-conversion/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
			</item>
		<item>
		<title>C Program for Binary Search and Towers of Hanoi using Recursion</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-for-binary-search-and-towers-of-hanoi-using-recursion/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-for-binary-search-and-towers-of-hanoi-using-recursion/#respond</comments>
		
		<dc:creator><![CDATA[Ansten Lobo]]></dc:creator>
		<pubDate>Sat, 09 Jun 2012 16:55:20 +0000</pubDate>
				<category><![CDATA[Advanced programs]]></category>
		<category><![CDATA[recursion]]></category>
		<category><![CDATA[c program]]></category>
		<category><![CDATA[binary search]]></category>
		<category><![CDATA[Towers of Hanoi]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=3319</guid>

					<description><![CDATA[<p>C Program for Binary Search and Towers of Hanoi using Recursion. Source: Dr. G T Raju, Professor &#038; Head, Dept. of CSE, RNSIT main() { int n,a[50],key,opn,i,pos; do { clrscr(); printf(" \n\n Press 1 -> Binary Search , 2-> Towers of Hanoi 3-> Quit\n"); scanf("%d",&#038;opn); switch(opn) { case 1: printf(" How Many Elements?"); scanf("%d",&#038;n); printf("</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-for-binary-search-and-towers-of-hanoi-using-recursion/">C Program for Binary Search and Towers of Hanoi using Recursion</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>C Program for Binary Search and Towers of Hanoi using Recursion.<br />
Source: Dr. G T Raju, Professor &#038; Head, Dept. of CSE, RNSIT</p>
<pre lang="C" line="1">
main()
{
    int n,a[50],key,opn,i,pos;
    do
    {
        clrscr();
        printf(" \n\n Press 1 -> Binary Search , 2-> Towers of Hanoi 3-> Quit\n");
        scanf("%d",&opn);
        switch(opn)
        {
        case 1: printf(" How Many Elements?");
            scanf("%d",&n);
            printf(" Read all the elements is ASC order \n");
            for(i=1;i<=n;i++)
                scanf("%d",&#038;a[i]);
            printf(" Read the Key Element\n");
            scanf("%d",&#038;key);
            pos=BS(a,key,1,n);
            if(pos)	 printf(" Success: %d found at %d \n", key,pos);
            else	 printf(" Falure: %d Not found in the list ! \n",key);
            break;
        case 2: printf("\n\n How Many Disks ?");
            scanf("%d", &#038;n);
            printf("\n\n Result of Towers of Hanoi for %d Disks \n",n);
            tower(n,'A','B','C');
            printf("\n\n Note: A-> Source, B-> Intermediate, C-> Destination\n");
            break;
        case 3: printf(" Terminating \n"); break;
        default: printf(" Invalid Option !! Try Again !! \n");
        }
        printf(" Press a Key. . . ");  getch();
    }while(opn != 3);
}
int BS(int a[], int key,int low,int high)
{
    int mid;
    if(low > high) return 0; /* failure */
    else
    {
        mid=(low+high)/2;
        if(a[mid]== key) return mid; /* Success */
        if(key < a[mid]) return(BS(a,key,low,mid-1));
        return(BS(a,key,mid+1,high));
    }
}
tower(int n, char src, char intr, char dst)
{
    if(n > 0)
    {
        tower(n-1,src,dst,intr);
        printf("Move disk %d from %c to %c \n", n,src,dst);
        tower(n-1,intr,src,dst);
    }
}
</pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-for-binary-search-and-towers-of-hanoi-using-recursion/">C Program for Binary Search and Towers of Hanoi using Recursion</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-for-binary-search-and-towers-of-hanoi-using-recursion/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
