<?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 programs | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/c-programs/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Sun, 11 Dec 2022 09:24:47 +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 to insert Student Records to a Sequential File</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-to-insert-student-records-to-a-sequential-file/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-to-insert-student-records-to-a-sequential-file/#respond</comments>
		
		<dc:creator><![CDATA[Ansten Lobo]]></dc:creator>
		<pubDate>Sat, 09 Jun 2012 11:41:46 +0000</pubDate>
				<category><![CDATA[Advanced programs]]></category>
		<category><![CDATA[c programs]]></category>
		<category><![CDATA[lab programs]]></category>
		<category><![CDATA[Sequential File]]></category>
		<category><![CDATA[insert records]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=3288</guid>

					<description><![CDATA[<p>Source: Dr. G T Raju, Professor &#038; Head, Dept. of CSE, RNSIT #include typedef struct { int usn; char name[25]; int m1,m2,m3; }STD; STD s; void display(FILE *); int search(FILE *,int); void main() { int i,n,usn_key,opn; FILE *fp; printf(" How many Records ? "); scanf("%d",&#038;n); fp=fopen("stud.dat","w"); for(i=0;i</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-to-insert-student-records-to-a-sequential-file/">C program to insert Student Records to a Sequential File</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">
#include <stdio.h>
typedef struct
{
    int usn;
    char name[25];
    int m1,m2,m3;
}STD;
STD s;
void display(FILE *);
int search(FILE *,int);
void main()
{
    int i,n,usn_key,opn;
    FILE *fp;
    printf(" How many Records ? ");
    scanf("%d",&n);
    fp=fopen("stud.dat","w");
    for(i=0;i<n;i++)
    {
        printf("Read the Info for Student: %d (usn,name,m1,m2,m3) \n",i+1);
        scanf("%d%s%d%d%d",&#038;s.usn,s.name,&#038;s.m1,&#038;s.m2,&#038;s.m3);
        fwrite(&#038;s,sizeof(s),1,fp);
    }
    fclose(fp);
    fp=fopen("stud.dat","r");
    do
    {
        printf("Press 1- Display\t 2- Search\t 3- Exit\t Your Option?");
        scanf("%d",&#038;opn);
        switch(opn)
        {
        case 1: printf("\n Student Records in the File \n");
            display(fp);
            break;
        case 2: printf(" Read the USN of the student to be searched ?");
            scanf("%d",&#038;usn_key);
            if(search(fp,usn_key))
            {
                printf("Success ! Record found in the file\n");
                printf("%d\t%s\t%d\t%d\t%d\n",s.usn,s.name,s.m1,s.m2,s.m3);
            }
            else
                printf(" Failure!! Record with USN %d not found\n",usn_key);
            break;
        case 3:  printf(" Exit!! Press a key . . .");
            getch();
            break;
        default:  printf(" Invalid Option!!! Try again !!!\n");
            break;
        }
    }while(opn != 3);
    fclose(fp);
}   /* End of main() */
void display(FILE *fp)
{
    rewind(fp);
    while(fread(&#038;s,sizeof(s),1,fp))
        printf("%d\t%s\t%d\t%d\t%d\n",s.usn,s.name,s.m1,s.m2,s.m3);
}
int search(FILE *fp, int usn_key)
{
    rewind(fp);
    while(fread(&#038;s,sizeof(s),1,fp))
        if( s.usn == usn_key) return 1;
    return 0;
}
</pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-to-insert-student-records-to-a-sequential-file/">C program to insert Student Records to a Sequential File</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-insert-student-records-to-a-sequential-file/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>C program to implement queue operations</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-to-implement-queue-operations/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-to-implement-queue-operations/#respond</comments>
		
		<dc:creator><![CDATA[Drithi]]></dc:creator>
		<pubDate>Tue, 05 Jun 2012 09:43:43 +0000</pubDate>
				<category><![CDATA[Data Structures]]></category>
		<category><![CDATA[queue overflow]]></category>
		<category><![CDATA[c programs]]></category>
		<category><![CDATA[Queue]]></category>
		<category><![CDATA[data structures]]></category>
		<category><![CDATA[queue operations]]></category>
		<category><![CDATA[queue underflow]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=3129</guid>

					<description><![CDATA[<p>Below is the C program to implement various queue operations, #include #include #define max 5 int q[10],front=0,rear=-1; void main() { int ch; void insert(); void delet(); void display(); clrscr(); printf("\nQueue operations\n"); printf("1.insert\n2.delete\n3.display\n4.exit\n"); while(1) { printf("Enter your choice:"); scanf("%d",&#038;ch); switch(ch) { case 1: insert(); break; case 2: delet(); break; case 3:display(); break; case 4:exit(); default:printf("Invalid option\n");</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-to-implement-queue-operations/">C program to implement queue operations</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 various queue operations,</p>
<pre lang="c" line="1">
#include<stdio.h>
#include<conio.h>
#define max 5
int q[10],front=0,rear=-1;
void main()
{
    int ch;
    void insert();
    void delet();
    void display();
    clrscr();
    printf("\nQueue operations\n");
    printf("1.insert\n2.delete\n3.display\n4.exit\n");
    while(1)
    {
        printf("Enter your choice:");
        scanf("%d",&ch);
        switch(ch)
        {
        case 1: insert();
            break;
        case 2: delet();
            break;
        case 3:display();
            break;
        case 4:exit();
        default:printf("Invalid option\n");
        }
    }
}

void insert()
{
    int x;
    if(rear==max-1)
        printf("Queue is overflow\n");
    else
    {
        printf("Enter element to be insert:");
        scanf("%d",&x);
        q[++rear]=x;
    }
}
void  delet()
{
    int a;
    if((front==0)&&(rear==-1))
    {
        printf("Queue is underflow\n");
        getch();
        exit();
    }
    a=q[front++];
    printf("Deleted element is:%d\n",a);
    if(front>rear)
    {
        front=0;
        rear=-1;
    }
}

void display()
{
    int i;
    if(front==0&&rear==-1)
    {
        printf("Queue is underflow\n");
        getch();
        exit();
    }
    for(i=front;i<=rear;i++)
        printf("\t%d",q[i]);
    printf("\n");
}
getch();
</pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-to-implement-queue-operations/">C program to implement queue 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/data-structures-c/c-program-to-implement-queue-operations/feed/</wfw:commentRss>
			<slash:comments>0</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>
		<item>
		<title>C program for sorting a Linked List</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-for-sorting-a-linked-list/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-for-sorting-a-linked-list/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Sun, 04 Apr 2010 16:34:49 +0000</pubDate>
				<category><![CDATA[Data Structures]]></category>
		<category><![CDATA[sorting Linked List]]></category>
		<category><![CDATA[c Linked List]]></category>
		<category><![CDATA[linked list]]></category>
		<category><![CDATA[c programs]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1151</guid>

					<description><![CDATA[<p>C program for sorting a Linked List. #include #include #include #include void main (int argc,char * argv[]) { DIR * directory_pointer; struct dirent* entry; struct File list { char filename[64]; struct File * new; } start,*node,* previous, * new; if((directory_pointer=opendir(argv[1]))==NULL) printf("Error opening %s\n", argv[1]); else { start.next + NULL; while (entry = readdir (directory_pointer)) {</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-for-sorting-a-linked-list/">C program for sorting a Linked List</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>C program for sorting a Linked List.</p>
<pre lang="c">
#include<stdio.h>
#include<dirent.h>
#include<malloc.h>
#include<string.h>

void main (int argc,char * argv[])
{
	DIR * directory_pointer;
	struct dirent* entry;
	struct File list 
	{
		char filename[64];
		struct File * new;
	}
	start,*node,* previous, * new;
	if((directory_pointer=opendir(argv[1]))==NULL)
		printf("Error opening %s\n", argv[1]);
	else
	{
		start.next + NULL;
		while (entry = readdir (directory_pointer))
		{
			/* Find the correct location */
			previous= Start ;;
			node = start.next;
			while ((node) &&(strcmp(entry->d_name,node->filename)>0))
			{
				node = node ->next;
				previous + previous->next;
			}
			new =(struct File List *) malloc(size File List));
			if(new += = NULL)
			{
				printf("Insufficient memory to store list\n");
				exit(1);
			}
			new ->next =node;
			previous ->next =new;
			strcpy(new->filename,entry->d_name);
		}
		closedir(directory_pointer);
		node = start.next;
		while (node)
		{
			printf("%s\n", node->filename);
			node = node->next;
		}
	}
}
</pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/data-structures-c/c-program-for-sorting-a-linked-list/">C program for sorting a Linked List</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-sorting-a-linked-list/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>C++ program to calculate the factorial of a number using recursion.</title>
		<link>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-basic/c-program-to-calculate-the-factorial-of-a-number-using-recursion/</link>
					<comments>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-basic/c-program-to-calculate-the-factorial-of-a-number-using-recursion/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Sun, 04 Apr 2010 12:56:18 +0000</pubDate>
				<category><![CDATA[Basic Programs]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[calculate factorial]]></category>
		<category><![CDATA[recursion]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[c programs]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1134</guid>

					<description><![CDATA[<p>Write a program to calculate the factorial of a number using recursion. #include #include void main() { int n,fact; int rec(int); clrscr(); cout>n; fact=rec(n); cout</p>
<p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-basic/c-program-to-calculate-the-factorial-of-a-number-using-recursion/">C++ program to calculate the factorial of a number using recursion.</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Write a program to calculate the factorial of a number using recursion.</p>
<pre lang="cpp">
#include<iostream.h>
#include<conio.h>
void main()
{
	int n,fact;
	int rec(int); clrscr();
	cout<<"Enter the number:->";
	cin>>n;
	fact=rec(n);
	cout<<endl<<"Factorial Result are:: "<<fact<<endl;
	getch();
}
rec(int x)
{
	int f;
	if(x==1)
		return(x);
	else
	{
		f=x*rec(x-1);
		return(f);
	}
}
</pre><p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-basic/c-program-to-calculate-the-factorial-of-a-number-using-recursion/">C++ program to calculate the factorial of a number using recursion.</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-basic/c-program-to-calculate-the-factorial-of-a-number-using-recursion/feed/</wfw:commentRss>
			<slash:comments>20</slash:comments>
		
		
			</item>
		<item>
		<title>C++ program to print student details using constructor and destructor</title>
		<link>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-print-student-details-using-constructor-and-destructor/</link>
					<comments>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-print-student-details-using-constructor-and-destructor/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Fri, 12 Mar 2010 18:22:49 +0000</pubDate>
				<category><![CDATA[Advanced programs]]></category>
		<category><![CDATA[Algorithms]]></category>
		<category><![CDATA[c programs]]></category>
		<category><![CDATA[cpp class]]></category>
		<category><![CDATA[destructor]]></category>
		<category><![CDATA[constructor]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1046</guid>

					<description><![CDATA[<p>AIM: A program to print student details using a constructor and destructor. ALGORITHM: PROGRAM Output:</p>
<p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-print-student-details-using-constructor-and-destructor/">C++ program to print student details using constructor and destructor</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><strong>AIM: </strong></p>



<p>A program to print student details using a constructor and destructor.</p>



<p><strong>ALGORITHM:</strong></p>



<ol>
<li>Start the process</li>



<li>Invoke the classes</li>



<li>Call the read() function
<ul>
<li>Get the inputs name, roll number and address</li>
</ul>
</li>



<li>Call the display() function
<ul>
<li>Display the name, roll number, and address of the student</li>
</ul>
</li>



<li>Stop the process</li>
</ol>



<p><strong>PROGRAM</strong></p>



<pre class="wp-block-code"><code lang="cpp" class="language-cpp">#include &lt;iostream>
using namespace std;

class student
{
	private: char name[20],add[20];
	  	int roll,zip;
	public: student ( ); //Constructor
		~student( ); //Destructor
		void read( );
		void disp( );			
};

student :: student( )
{
	cout&lt;&lt;"Student class constructor called."&lt;&lt;endl;
}

void student :: read( )
{
	cout&lt;&lt;"Enter the student Name: ";
	cin>>name;
	cout&lt;&lt;"Enter the student roll no: “;
	cin>>roll;
	cout&lt;&lt;"Enter the student address: ";
	cin>>add;
	cout&lt;&lt;"Enter the Zipcode: ";
	cin>>zip;
}

void student :: disp( )
{
	cout&lt;&lt;"Studet details"&lt;&lt;endl;
	cout&lt;&lt;"Student Name   :"&lt;&lt;name&lt;&lt;endl;
	cout&lt;&lt;"Roll no is     :"&lt;&lt;roll&lt;&lt;endl;
	cout&lt;&lt;"Address is     :"&lt;&lt;add&lt;&lt;endl;
	cout&lt;&lt;"Zipcode is     :"&lt;&lt;zip&lt;&lt;endl;
}

student :: ~student( )
{
	cout&lt;&lt;"Student class destructor called.";
}
 
int main( )
{
	student s;
	s.read();
	s.disp();
}</code></pre>



<p><strong>Output:</strong></p>



<pre class="wp-block-code"><code lang="" class="">Student class constructor called.

Enter the student Name: Rajesh
Enter the student roll no: 1234
Enter the student address: Bangalore
Enter the Zipcode: 560001

Studet details
Student Name   :Rajesh
Roll no is     :1234
Address is     :Bangalore
Zipcode is     :560001

Student class destructor called.</code></pre>



<p></p><p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-print-student-details-using-constructor-and-destructor/">C++ program to print student details using constructor and destructor</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-print-student-details-using-constructor-and-destructor/feed/</wfw:commentRss>
			<slash:comments>34</slash:comments>
		
		
			</item>
		<item>
		<title>C++ program to implement circular queue ADT using an array</title>
		<link>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-program-to-implement-circular-queue-adt-using-an-array/</link>
					<comments>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-program-to-implement-circular-queue-adt-using-an-array/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Thu, 11 Mar 2010 14:21:47 +0000</pubDate>
				<category><![CDATA[Data structure]]></category>
		<category><![CDATA[Abstract data type]]></category>
		<category><![CDATA[c programs]]></category>
		<category><![CDATA[circular queue]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1015</guid>

					<description><![CDATA[<p>/* Write a C++ program to implement circular queue ADT using an array */ #include #include #include using namespace std; class cqueue { int q[5],front,rare; public: cqueue() { front=-1; rare=-1; } void push(int x) { if(front ==-1 &#038;& rare == -1) { q[++rare]=x; front=rare; return; } else if(front == (rare+1)%5 ) { cout</p>
<p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-program-to-implement-circular-queue-adt-using-an-array/">C++ program to implement circular queue ADT using an array</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>/* Write a C++ program to implement circular queue ADT using an array */</p>
<pre lang="cpp">
#include<iostream>
#include<conio.h>
#include<stdlib.h>
using namespace std;
class cqueue
{
   int q[5],front,rare;
   public:
      cqueue()
      {
	 front=-1;
	 rare=-1;
      }
      void push(int x)
      {
	 if(front ==-1 && rare == -1)
	 {
	   q[++rare]=x;
	   front=rare;
	   return;
	 }
	 else if(front == (rare+1)%5 )
	 {
	    cout <<" Circular Queue over flow";
	    return;
	 }
	 rare= (rare+1)%5;
	 q[rare]=x;
     }

     void pop()
     {
	if(front==-1 &#038;&#038; rare==	-1)
	{
	  cout <<"under flow";
	  return;
	}
	else if( front== rare  )
	{
	  front=rare=-1;
	  return;
	}
	front= (front+1)%5;
     }
   



 void display()
    {
      int i;
      if( front <= rare)
      {
	for(i=front; i<=rare;i++)
	cout << q[i]<<" ";
      }
      else
      {
	 for(i=front;i<=4;i++)
	 {
	   cout <<q[i] << " ";
	 }
	 for(i=0;i<=rare;i++)
	 {
	    cout << q[i]<< " ";
	 }
      }
    }
};

main()
{

int ch;
cqueue q1;
while( 1)
{
cout<<"\n1.INSERT   2.DELETE   3.DISPLAY    4.EXIT\nEnter ur choice";
cin >> ch;
switch(ch)
{
case 1: cout<<"enter element";
	cin >> ch;
	q1.push(ch); break;

case 2: q1.pop(); break;
case 3: q1.display(); break;
case 4: exit(0);
}
}
}
</pre>
<p><strong>OUTPUT</strong></p>
<p>1.INSERT   2.DELETE   3.DISPLAY    4.EXIT<br />
Enter ur choice1<br />
enter element4</p>
<p>1.INSERT   2.DELETE   3.DISPLAY    4.EXIT<br />
Enter ur choice1<br />
enter element5</p>
<p>1.INSERT   2.DELETE   3.DISPLAY    4.EXIT<br />
Enter ur choice1<br />
enter element3</p>
<p>1.INSERT   2.DELETE   3.DISPLAY    4.EXIT<br />
Enter ur choice3<br />
4 5 3</p>
<p>1.INSERT   2.DELETE   3.DISPLAY    4.EXIT<br />
Enter ur choice2</p>
<p>1.INSERT   2.DELETE   3.DISPLAY    4.EXIT<br />
Enter ur choice3<br />
5 3</p>
<p>1.INSERT   2.DELETE   3.DISPLAY    4.EXIT<br />
Enter ur choice4</p><p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-program-to-implement-circular-queue-adt-using-an-array/">C++ program to implement circular queue ADT using an array</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-program-to-implement-circular-queue-adt-using-an-array/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>C++ programs to implement the Queue ADT using an array</title>
		<link>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-programs-to-implement-the-queue-adt-using-an-array/</link>
					<comments>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-programs-to-implement-the-queue-adt-using-an-array/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Wed, 10 Mar 2010 17:30:22 +0000</pubDate>
				<category><![CDATA[Data structure]]></category>
		<category><![CDATA[c programs]]></category>
		<category><![CDATA[Queue]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1007</guid>

					<description><![CDATA[<p>/* Write C++ programs to implement the Queue ADT using an array */ #include #include #include using namespace std; class queue { int queue1[5]; int rear,front; public: queue() { rear=-1; front=-1; } void insert(int x) { if(rear > 4) { cout</p>
<p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-programs-to-implement-the-queue-adt-using-an-array/">C++ programs to implement the Queue ADT using an array</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>/* Write C++ programs to implement the Queue ADT using an array */</p>
<pre lang="cpp">
#include<iostream>
#include<conio.h>
#include<stdlib.h>
using namespace std;

class queue
{
              int queue1[5];
              int rear,front;
      public:
              queue()
                {
                     rear=-1;
                     front=-1;
                }
              void insert(int x)
               {
                   if(rear >  4)
                    {
                       cout <<"queue over flow";
                       front=rear=-1;
                       return;
                    }
                    queue1[++rear]=x;
                    cout <<"inserted" <<x;
               }
              void delet()
               {
                   if(front==rear)
                     {
                         cout <<"queue under flow";
                         return;
                     }
                     cout <<"deleted" <<queue1[++front];
                }
              void display()
               {
                   if(rear==front)
                     {
                          cout <<" queue empty";
                          return;
                     }
                   for(int i=front+1;i<=rear;i++)
                   cout <<queue1[i]<<" ";
               }
};

main()
{
      int ch;
      queue qu;
      while(1)
        {
              cout <<"\n1.insert  2.delet  3.display  4.exit\nEnter ur choice";
              cin >> ch;
              switch(ch)
                {
                  case 1:    cout <<"enter the element";
                           	 cin >> ch;
                             qu.insert(ch);
                             break;
                  case 2:  qu.delet();  break;
                  case 3:  qu.display();break;
                  case 4: exit(0);
                  }
          }
return (0);
}
</pre>
<p><strong>OUTPUT</strong><br />
1.insert  2.delet  3.display  4.exit<br />
Enter ur choice1<br />
enter the element21<br />
inserted21</p>
<p>1.insert  2.delet  3.display  4.exit<br />
Enter ur choice1<br />
enter the element22<br />
inserted22</p>
<p>1.insert  2.delet  3.display  4.exit<br />
Enter ur choice1<br />
enter the element16<br />
inserted16</p>
<p>1.insert  2.delet  3.display  4.exit<br />
Enter ur choice3<br />
21 22 16 </p>
<p>1.insert  2.delet  3.display  4.exit<br />
Enter ur choice2<br />
deleted21</p>
<p>1.insert  2.delet  3.display  4.exit<br />
Enter ur choice3<br />
22 16</p>
<p>1.insert  2.delet  3.display  4.exit<br />
Enter ur choice</p><p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-programs-to-implement-the-queue-adt-using-an-array/">C++ programs to implement the Queue ADT using an array</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-programs-to-implement-the-queue-adt-using-an-array/feed/</wfw:commentRss>
			<slash:comments>23</slash:comments>
		
		
			</item>
		<item>
		<title>C++ programs to implement the Stack ADT using an array</title>
		<link>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-programs-to-implement-the-stack-adt-using-an-array/</link>
					<comments>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-programs-to-implement-the-stack-adt-using-an-array/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Wed, 10 Mar 2010 17:22:49 +0000</pubDate>
				<category><![CDATA[Data structure]]></category>
		<category><![CDATA[c programs]]></category>
		<category><![CDATA[stack]]></category>
		<category><![CDATA[ADT]]></category>
		<category><![CDATA[array]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1003</guid>

					<description><![CDATA[<p>void push(int x)<br />
              {<br />
                 if(top >  4)<br />
                       {<br />
                           cout <<"stack over flow";
                           return;
                       }
                 stk[++top]=x;
                 cout <<"inserted" <<x;
               }
</p>
<p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-programs-to-implement-the-stack-adt-using-an-array/">C++ programs to implement the Stack ADT using an array</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>/* Write C++ programs to implement the Stack ADT using an array */</p>
<pre lang="cpp">
#include<iostream>
#include<conio.h>
#include<stdlib.h>
using namespace std;
class stack
{
             int stk[5];
             int top;
      public:
             stack()
              {
                top=-1;
               }
             void push(int x)
              {
                 if(top >  4)
                       {
                           cout <<"stack over flow";
                           return;
                       }
                 stk[++top]=x;
                 cout <<"inserted" <<x;
               }
             void pop()
               {
                  if(top <0)
                   {
                         cout <<"stack under flow";
                         return;
                    }
                    cout <<"deleted" <<stk[top--];
                }
             void display()
               {
                   if(top<0)
                    {
                            cout <<" stack empty";
                            return;
                    }
                    for(int i=top;i>=0;i--)
                    cout <<stk[i] <<" ";
                }
};

main()
{
     int ch;
     stack st;
     while(1)
        {
             cout <<"\n1.push  2.pop  3.display  4.exit\nEnter ur choice";
             cin >> ch;
             switch(ch)
              {
               case 1:  cout <<"enter the element";
                        cin >> ch;
                        st.push(ch);
                        break;
               case 2:  st.pop();  break;
               case 3:  st.display();break;
               case 4:  exit(0);
               }
         }
return (0);
}
</pre>
<p><strong>OUTPUTS</strong><br />
1.push  2.pop  3.display  4.exit<br />
Enter ur choice2<br />
stack under flow</p>
<p>1.push  2.pop  3.display  4.exit<br />
Enter ur choice1<br />
enter the element2<br />
inserted2</p>
<p>1.push  2.pop  3.display  4.exit<br />
Enter ur choice1<br />
enter the element3<br />
inserted3</p>
<p>1.push  2.pop  3.display  4.exit<br />
Enter ur choice2<br />
deleted3</p>
<p>1.push  2.pop  3.display  4.exit<br />
Enter ur choice1<br />
enter the element5<br />
inserted5</p>
<p>1.push  2.pop  3.display  4.exit<br />
Enter ur choice3<br />
5 2</p>
<p>1.push  2.pop  3.display  4.exit<br />
Enter ur choice4</p><p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-programs-to-implement-the-stack-adt-using-an-array/">C++ programs to implement the Stack ADT using an array</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-data-structure/c-programs-to-implement-the-stack-adt-using-an-array/feed/</wfw:commentRss>
			<slash:comments>22</slash:comments>
		
		
			</item>
	</channel>
</rss>
