<?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>Advanced programs | Student Projects</title>
	<atom:link href="https://studentprojects.in/category/software-development/c-tutorials/c/c-advanced/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Sat, 10 Dec 2022 04:29:07 +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>Least Recently Used Paging Algorithm</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/c-advanced/least-recently-used-paging-algorithm/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/c-advanced/least-recently-used-paging-algorithm/#comments</comments>
		
		<dc:creator><![CDATA[Arun]]></dc:creator>
		<pubDate>Wed, 17 Apr 2013 09:38:52 +0000</pubDate>
				<category><![CDATA[Advanced programs]]></category>
		<category><![CDATA[LRU]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=4033</guid>

					<description><![CDATA[<p>Least Recently Used Paging Algorithm #include "stdio.h" #include "conio.h" int fr[3]; void main() { void display(); int p[20]={1,0,7,1,0,2,1,2,3,0,3,2,4,0,3,0,2,1,0,7},i,j,fs[3]; int index,k,l,flag1=0,flag2=0,pf=0,frsize=3; clrscr(); for(i=0;i&#60;3;i++) { fr[i]=-1; } for(j=0;j&#60;20;j++) { flag1=0,flag2=0; for(i=0;i&#60;3;i++) { if(fr[i]==p[j]) { flag1=1; flag2=1; break; } } if(flag1==0) { for(i=0;i&#60;3;i++) { if(fr[i]==-1) { fr[i]=p[j]; flag2=1; break; } } } if(flag2==0) { for(i=0;i&#60;3;i++) fs[i]=0; for(k=j-1,l=1;l&#60;=frsize-1;l++,k--) {</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/c-advanced/least-recently-used-paging-algorithm/">Least Recently Used Paging Algorithm</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>Least Recently Used Paging Algorithm</p>
<pre lang="C" line="1">#include "stdio.h"
#include "conio.h"
int fr[3];
void main()
{
	void display();

	int p[20]={1,0,7,1,0,2,1,2,3,0,3,2,4,0,3,0,2,1,0,7},i,j,fs[3];
	int index,k,l,flag1=0,flag2=0,pf=0,frsize=3;
	clrscr();
	for(i=0;i&lt;3;i++)
	{
		fr[i]=-1;
	}
	for(j=0;j&lt;20;j++)
	{
		flag1=0,flag2=0;
		for(i=0;i&lt;3;i++)
		{
			if(fr[i]==p[j])
			{
				flag1=1;
				flag2=1;
				break;
			}
		}
		if(flag1==0)
		{
			for(i=0;i&lt;3;i++)
			{
				if(fr[i]==-1)
				{
					fr[i]=p[j];
					flag2=1;
					break;
				}
			}
		}
		if(flag2==0)
		{
			for(i=0;i&lt;3;i++)
				fs[i]=0;
			for(k=j-1,l=1;l&lt;=frsize-1;l++,k--)
			{
				for(i=0;i&lt;3;i++)
				{
					if(fr[i]==p[k])
						fs[i]=1;
				}
			}
			for(i=0;i&lt;3;i++)
			{
				if(fs[i]==0)
					index=i;
			}
			fr[index]=p[j];
			pf++;
		}
		display();
	}
	printf("\n no of page faults :%d",pf);
	getch();
}
void display()
{
	int i;
	printf("\n");
	for(i=0;i&lt;3;i++)
		printf("\t%d",fr[i]);
}
</pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/c-advanced/least-recently-used-paging-algorithm/">Least Recently Used Paging Algorithm</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/least-recently-used-paging-algorithm/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 program]]></category>
		<category><![CDATA[C Programs]]></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 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[c program]]></category>
		<category><![CDATA[recursion]]></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>
		<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[Sequential File]]></category>
		<category><![CDATA[c programs]]></category>
		<category><![CDATA[lab programs]]></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 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>Binary Search</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/c-advanced/binary-search/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/c-advanced/binary-search/#comments</comments>
		
		<dc:creator><![CDATA[Chitra]]></dc:creator>
		<pubDate>Mon, 15 Aug 2011 17:43:26 +0000</pubDate>
				<category><![CDATA[Advanced programs]]></category>
		<category><![CDATA[Searching programs]]></category>
		<category><![CDATA[c program]]></category>
		<category><![CDATA[binary search]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1591</guid>

					<description><![CDATA[<p>A binarysearch program locates the position of an item in a sorted array. Logic: The Binary search starts by testing the element at the middle of the array. Let us consider an array ‘a’ with all elements arranged in ascending order. Let low and high are the lower and upper indices of the array ‘a’, respectively. We want to search an item</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/c-advanced/binary-search/">Binary Search</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>A binarysearch program locates the position of an item in a sorted array.</p>
<p>Logic: The Binary search starts by testing the element at the middle of the array. Let us consider an array ‘a’ with all elements arranged in ascending order. Let low and high are the lower and upper indices of the array ‘a’, respectively. We want to search an item K in it. To do this, we calculate a middle index with the values of low and high, let it be mid. Then we compare if K=a[mid] or not.</p>
<p>If it is true, then search is done. Otherwise, the search is to be repeated on left or right half depending on the K&lt;a[mid] or K&gt;a[mid], respectively. In case of low =high and K a[mid], the search terminates unsuccessfully.</p>
<p><img decoding="async" loading="lazy" class="aligncenter wp-image-1641 size-full" title="Binary Search flow" src="https://studentprojects.in/wp-content/uploads/2011/08/BinarySearch.png" alt="Binary Search flow" width="583" height="207" /></p>
<p>Example 1:</p>
<p>Consider the following elements stored in an array,</p>
<p><img decoding="async" loading="lazy" class="aligncenter wp-image-1642 size-full" title="Binary Search example" src="https://studentprojects.in/wp-content/uploads/2011/08/BinarySearch_Ex1.png" alt="Binary Search example" width="581" height="402" /></p>
<p>Example 2:</p>
<p>Consider the following elements stored in an array,</p>
<p><img decoding="async" loading="lazy" class="aligncenter wp-image-1643 size-full" title="Binary Search example" src="https://studentprojects.in/wp-content/uploads/2011/08/BinarySearch_Ex2.png" alt="Binary Search example" width="584" height="430" /></p>
<p>Program:</p>
<pre lang="c" line="1" escaped="true">#include"stdio.h"
#include"conio.h"
void main()
{
	int a[25], i, n, K, flag = 0, low, high, mid;
	clrscr();
	printf("Enter the number of elementsn");
	scanf("%d", &amp;n);
	printf("Enter the elementsn");
	for(i = 0; i&lt;n; i++)
	{
		scanf("%d",&amp;a[i]);
	}
	printf("Enter the key to be searchedn");
	scanf("%d",&amp;K);
	low = 0;
	high = n - 1;
	while(low &lt;= high)
	{
		mid = (low+high)/2;
		if(a[mid] == K)
		{
			flag = 1;
			break;
		}
		else if(K&lt;a[mid])
			high = mid-1;
		else
			low = mid + 1;
	}
	if(flag == 1)
	{
		printf("Key element is found");
	}
	else
	{
		printf("Key element not found");
	}
	getch();
}
</pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/c-advanced/binary-search/">Binary Search</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/binary-search/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Priority schedueling with &#038; without preemtion, with aging, with different arrival times</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/c-advanced/priority-schedueling-preemtion-aging-arrival-times/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/c-advanced/priority-schedueling-preemtion-aging-arrival-times/#respond</comments>
		
		<dc:creator><![CDATA[rayan daou]]></dc:creator>
		<pubDate>Mon, 30 May 2011 09:10:19 +0000</pubDate>
				<category><![CDATA[Advanced programs]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1490</guid>

					<description><![CDATA[<p>#include"stdio.h" #include"conio.h" typedef struct{ int arrival; int burst; int priorty; int index; int status; }process; void swap(process *x,process *y) { process temp; temp = *x; *x = *y; *y = temp; } void bublesort(process p[], int n) { int i,j; for(i=0;ip[j+1].priorty)) swap(&#038;p[j],&#038;p[j+1]); } void sortpr(process p[],int n) { int i,j; for(i=0;i</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/c-advanced/priority-schedueling-preemtion-aging-arrival-times/">Priority schedueling with & without preemtion, with aging, with different arrival times</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<pre lang="c" line="1">
#include"stdio.h"
#include"conio.h"
typedef struct{

    int arrival;
    int burst;
    int priorty;
    int index;
    int status;
}process;

void swap(process *x,process *y)
{
    process temp;
    temp = *x;
    *x = *y;
    *y = temp;
}

void bublesort(process p[], int n)
{

    int i,j;
    for(i=0;i<(n-1);i++)
        for(j=0;j<(n-(i+1));j++)
            if(p[j].arrival > p[j+1].arrival||(p[j].arrival==p[j+1].arrival&&p[j].priorty>p[j+1].priorty))
                swap(&p[j],&p[j+1]);
}

void sortpr(process p[],int n)
{
    int i,j;
    for(i=0;i<(n-1);i++)
        for(j=0;j<(n-(i+1));j++)
            if(p[j].priorty > p[j+1].priorty)
                swap(&p[j],&p[j+1]);
}

void deletep(process p[],int size,int index)
{ 
    int i=index;
    while(i<size-1)
    {
        p[i]=p[i+1];
        i++;
    }
    return;
}

bool nonew(process p[],int size)
{ 
    for(int i=0;i<size;i++)
    {
        if(p[i].status==0 )return false;
    }
    return true;
}

bool noready(process p[],int size)
{
    for(int i=0;i<size;i++)
        if(p[i].status==1)
            return false;
    return true;
}

int ready(process p[],int size)
{ 
    int min=0;
    for(int i=0;i<size;i++)
        if(p[i].status==1&#038;&#038;p[i].priorty<p[min].priorty)
            min=i;
    return min;
}

void NonPreemtive(process p[],int size)
{ 
    int i,j,minpr,current=p[0].arrival;
    for(i=0;i<size-1;i++)
    {
        printf("p%d from %d to %d\n",p[i].index,current,current+p[i].burst);
        current=current+p[i].burst;
        if (p[i+1].arrival==current)
        {
            continue;
        }
        else{
            if(p[i+1].arrival>current){
                current=p[i+1].arrival;}
            else{ j=i+1;
            minpr=p[j].priorty;
            for(j=i+1;j<size;j++)
            { 
                if(p[j].arrival<current){
                    if (p[j].priorty<minpr){
                        minpr=p[j].priorty;
                        swap(&#038;p[i+1],&#038;p[j]);
                    }
                }
            }
            }
        }
}
    printf("p%d from %d to %d\n",p[i].index,current,current+p[i].burst);
}

void NonPreemtiveAging(process p[],int size)
{
    int i,j,minpr,current=p[0].arrival;
    for(i=0;i<size-1;i++)
    { 
        printf("p%d from %d to %d\n",p[i].index,current,current+p[i].burst);
        current=current+p[i].burst;
        if (p[i+1].arrival==current)
        {
            continue;
        }
        else{
            if(p[i+1].arrival>current){
                current=p[i+1].arrival;
            }
            else{ j=i+1;
            minpr=p[j].priorty-(current-p[j].arrival)/5;
            for(j=i+1;j<size;j++)
            { 
                if(p[j].arrival<current){
                    if (p[j].priorty-(current-p[j].arrival)/5<minpr)
                    {
                        minpr=p[j].priorty-(current-p[j].arrival)/5;
                        swap(&#038;p[i+1],&#038;p[j]);
                    }
                }
            }
            }
        }
    }
    printf("p%d from %d to %d\n",p[i].index,current,current+p[i].burst);
}

void Preemtive(process p[],int size)
{
    int i=0,current=p[0].arrival,j,test;
    while(size!=0)
    {
        printf("p%d from %d to ",p[i].index,current);
        if(nonew(p,size)){
            printf("%d\n",current+p[i].burst);
            current=current+p[i].burst;
            deletep(p,size,i);
            size--;
            if(size==0) break;
            i=ready(p,size);
            continue;
        }
        else{test=0;
        for(j=0;j<size;j++)
        {
            if(p[j].arrival<current+p[i].burst)    
            {
                if(p[j].status==1)continue;
                if(p[j].priorty<p[i].priorty)
                {
                    printf(" %d\n",p[j].arrival);
                    p[i].burst=p[i].burst-(p[j].arrival-current);
                    p[i].status=1;
                    current=p[j].arrival;
                    test=1;
                    i=j;
                    break;
                }else p[j].status=1;
            }else if(p[j].arrival==current+p[i].burst)p[j].status=1;
        }
        if(test==1)continue;
        printf("%d\n",current+p[i].burst);
        current=current+p[i].burst;
        deletep(p,size,i);
        size--;
        if (!noready(p,size))
        {
            i=ready(p,size);
        }
        else {
            current=p[i].arrival;}
        }
    }
    return;
}

void main()
{
    process p[5];
    int i,c;
    printf("Welcome\n");
    printf( "Choose the mode of scedueling:\npress 1 for non preemtive\npress 2 for non preemtive with aging\npress 3 for preemptive\n");
    scanf("%d",&#038;c);
    for (i=0;i<5;i++)
    {
        printf("\nenter the arrival time of p %d:",i);
        scanf("%d",&#038;p[i].arrival);
        printf("enter the burst time of p %d:",i);
        scanf("%d",&#038;p[i].burst);
        printf("enter the priorty of p %d:",i);
        scanf("%d",&#038;p[i].priorty);
        p[i].status=0;
        p[i].index=i;
    }
    bublesort(p,5);
    printf("\nsorted:\nprocess arrival time burst time priorty\n");
    for (i=0;i<5;i++)
    {
        printf( " p%d %d %d %d\n",p[i].index,p[i].arrival,p[i].burst,p[i].priorty);
    }
    if(c==1)
        NonPreemtive(p,5);
    else{
        if(c==2) NonPreemtiveAging(p,5);
        else if (c==3)Preemtive(p,5);
    }
    getch();
}
</pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/c-advanced/priority-schedueling-preemtion-aging-arrival-times/">Priority schedueling with & without preemtion, with aging, with different arrival times</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/priority-schedueling-preemtion-aging-arrival-times/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>C program to implement tower of Hanoi problem</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-to-implement-tower-of-hanoi-problem/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-to-implement-tower-of-hanoi-problem/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Sun, 04 Apr 2010 17:28:33 +0000</pubDate>
				<category><![CDATA[Advanced programs]]></category>
		<category><![CDATA[solutions]]></category>
		<category><![CDATA[tower of Hanoi problem]]></category>
		<category><![CDATA[c program]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1158</guid>

					<description><![CDATA[<p>To implement tower of Hanoi problem. #include void hanoi_tower(char,char,char,int); void hanoi_tower(char peg1,char peg2,char pege3,int n) { if(n</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-to-implement-tower-of-hanoi-problem/">C program to implement tower of Hanoi problem</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>To implement tower of Hanoi problem.</p>
<pre lang="c">
#include<stdio.h> 	  
void hanoi_tower(char,char,char,int);
void hanoi_tower(char peg1,char peg2,char pege3,int n)
{
	if(n<=0)
        printf("\n Illegal Entry");
        if(n==1)
			printf ("\n Move disk from %c to %c", pege1,pege3);
		else
		{
		   hanoi_tower(peg1,peg3,peg2,n-1);
		   hanoi_tower(peg1,peg2,peg3,1);
		   hanoi_tower(peg2,peg1,peg3,n-1);
		}
}
Void main ()
{
    int n;
    printf("\n Input the number of dise:);
    scanf("%d", &#038;n);
    printf("\n Tower of Hanoi for 5th DISC", n);
    hanoi_tower('x','y','z',n);
}
</pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-to-implement-tower-of-hanoi-problem/">C program to implement tower of Hanoi problem</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-implement-tower-of-hanoi-problem/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
		<item>
		<title>C program to Implement Morse code to text conversion and vice-versa.</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-to-implement-morse-code-to-text-conversion-and-vice-versa/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-to-implement-morse-code-to-text-conversion-and-vice-versa/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Sun, 04 Apr 2010 15:52:44 +0000</pubDate>
				<category><![CDATA[Advanced programs]]></category>
		<category><![CDATA[c program]]></category>
		<category><![CDATA[Source Codes]]></category>
		<category><![CDATA[text conversion]]></category>
		<category><![CDATA[Morse code]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[free]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1146</guid>

					<description><![CDATA[<p>C program to Implement Morse code to text conversion and vice-versa. #include #include #include #include void main() { char str[25],str1[100]; clrscr(); fflush(stdin); printf("enter the String"); gets(str); int j=0; for(int i=0;i</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-to-implement-morse-code-to-text-conversion-and-vice-versa/">C program to Implement Morse code to text conversion and vice-versa.</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>C program to Implement Morse code to text conversion and vice-versa.</p>
<pre lang="c">
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<process.h>

void main()
{
	char str[25],str1[100];
	clrscr();
	fflush(stdin);
	printf("enter the String");
	gets(str);

	int j=0;
	for(int i=0;i<=strlen(str);++)
	{
		switch(toupper(str[i]))
		{
		  case 'A':
		  str1[j++]='.';
		  str1[j]='.';
		  break;
		  
		  case 'b':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='.';
		  break;

		  case 'c':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='.';
		  break;

		  case 'D':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='.';
		  break;

		  case 'E':
		  str1[j]='.';
		  break;

		  case 'F':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='.';
		    break;

		  case 'G':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='.';
		  break;

		  case 'H':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='.';
		    break;

		   case 'I':
		  str1[j++]='.';
		  str1[j]='.';
		    break;

		case 'J':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='.';
		    break;

		case 'K':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='.';
		    break;

		case 'L':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='.';
		  break;

		case 'M':
		  str1[j++]='-';
		    str1[j]='-';
		    break;

		case 'N':
		  str1[j++]='-';
		  str1[j]='.';
		    break;

		case 'O':
		  str1[j++]='-';
		  str1[j++]='-';
		  str1[j]='.';
		    break;

		case 'P':
		  str1[j++]='.';
		  str1[j++]='-';
		  str1[j++]='-';
		  str1[j]='.';
		    break;

		case 'Q':
		  str1[j++]='-';
		  str1[j++]='-';
		  str1[j++]='.';
		  str1[j]='.';
		    break;

		case 'R':
		  str1[j++]='.';
		  str1[j++]='-';
		  str1[j]='.';
		    break;

		case 'S':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='.';
		    break;

		case 'T':
		  str1[j]='-';
		    break;
			
		case 'U':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='.';
		    break;

		case 'V':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='-';
		    break;

		case 'W':
		  str1[j++]='.';
		  str1[j++]='-';
		  str1[j]='-';
		    break;

		case 'X':
		  str1[j++]='-';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='-';
		    break;

		case 'y':
		  str1[j++]='-';
		  str1[j++]='.';
		  str1[j++]='-';
		  str1[j]='.';
		    break;

		case 'Z':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='.';
		    break;

		case '0':
		  str1[j++]='-';
		  str1[j++]='-';
		  str1[j++]='-';
		  str1[j++]='-';
		  str1[j]='-';
		    break;
			
		case '1':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='-';
		  str1[j++]='-'; 
		  str1[j]='-';
		    break;

		case '2':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='.';
		    break;

		case 'F':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='.';
		    break;

		case '3':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='-';
		  str1[j]='.';
		    break;

		case '4':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='-';
		    break;

		case '5':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='.';
		    break;

		case '6':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='-';
		    break;

		case '7':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='-';
		    break;

		case '8':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='-';
		    break;

		case '9':
		  str1[j++]='-';
		  str1[j++]='-';
		  str1[j++]='-';
		  str1[j++]='-';
		  str1[j]='.';
		    break;

		case '.':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='-';
		    break;

		case ',':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='-';
		    break;

		case ':':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='-';
		    break;

		case '?':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='-';
		    break;

		/* case '\';
		  str1[j++]='.';
		  str1[j++]='.'; 
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='-';
		    break; */

		case '-':
		  str1[j++]='-';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='-';
		    break;

		case ';':
		  str1[j++]='-';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='-';
		  str1[j]='.';
		    break;

		case '(':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='-';
		    break;

		case ')':
		  str1[j++]='.';
		  str1[j++]='.'; 
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='-';
		    break;

		case ']':
		  str1[j++]='-';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='-';
		  str1[j++]='-';
		  str1[j]='-';
		    break;

		case '[':
		  str1[j++]='-';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='-';
		  str1[j++]='-';
		  str1[j]='.';
		    break;

		case '}':
		  str1[j++]='-';
		  str1[j++]='.';
		  str1[j++]='-';
		  str1[j++]='-';
		  str1[j++]='.';
		  str1[j]='-';
		    break;
			
		case '{':
		  str1[j++]='-';
		  str1[j++]='.';
		  str1[j++]='-';
		  str1[j++]='-';
		  str1[j++]='.';
		  str1[j]='-';
		    break;

		case '"':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='-';
		    break;

		case '+':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='-';
		    break;

		case '/':
		  str1[j++]='.';
		  str1[j++]='.';  
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='-';
		    break;

		case '%':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='-';
		    break;

		case '&#038;':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='-';
		    break;

		case '$':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='-';
		    break;

		case '*':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='-';
		    break;

		case '^':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='-';
		    break;

		case '#':
		  str1[j++]='.';
		  str1[j++]='.';  
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='-';
		    break;

		case '@':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='-';
		    break;

		case '=':
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j++]='.';
		  str1[j]='';
		    break;
		}
	    j++;
	}
	str1[j-1]='\0';
	puts(str1);
	getch();
 }
</pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-to-implement-morse-code-to-text-conversion-and-vice-versa/">C program to Implement Morse code to text conversion and vice-versa.</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-implement-morse-code-to-text-conversion-and-vice-versa/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
			</item>
		<item>
		<title>C program for Syntax Analyzer</title>
		<link>https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-for-syntax-analyzer/</link>
					<comments>https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-for-syntax-analyzer/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Mon, 29 Mar 2010 16:54:13 +0000</pubDate>
				<category><![CDATA[Advanced programs]]></category>
		<category><![CDATA[codes]]></category>
		<category><![CDATA[c program]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[Syntax Analyzer]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1128</guid>

					<description><![CDATA[<p>C program for Syntax Analyzer #include #include #include #include void main() { int i,j,k=0,count,inc=0,n; char name[30],open[30],ch,chh,o[30]; char op[20]={'=','+','-','*','/','%','^','&#038;','&#124;'}; clrscr(); textcolor(3); cprintf("--Syntax Analyser--"); printf("\n"); printf("\n Enter Syntax"); printf("\n"); scanf("%s",name); n=strlen(name); for(i=0;i</p>
<p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-for-syntax-analyzer/">C program for Syntax Analyzer</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>C program for Syntax Analyzer</p>
<pre lang="c">
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<ctype.h>
void main()
 {
    int i,j,k=0,count,inc=0,n;
   char name[30],open[30],ch,chh,o[30];
   char op[20]={'=','+','-','*','/','%','^','&','|'};
   clrscr();
   textcolor(3);
   cprintf("--Syntax Analyser--");
   printf("\n");
   printf("\n Enter Syntax");
   printf("\n");
   scanf("%s",name);
   n=strlen(name);
   for(i=0;i<n;i++)
    {
      ch=tolower(name[i]);
      for(j=0;j<9;j++)
      {
        if(ch==op[j])
         {
           open[k]=i;
           o[k]=ch;
           k++;
         }
      }
   }
   for(i=0;i<k;i++)
    {
      count=open[i];
      ch=tolower(name[count-1]);
      chh=tolower(name[count+1]);
      if(isalpha(ch)&#038;&#038;isalpha(chh)||isdigit(chh))
       ++inc;
     }
   if(k==inc)
  printf("\n %s is a valid syntax",name);
 else
  printf("\n %s is an invalid syntax",name);
  getch();
}
</pre><p>The post <a href="https://studentprojects.in/software-development/c-tutorials/c/c-advanced/c-program-for-syntax-analyzer/">C program for Syntax Analyzer</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-syntax-analyzer/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
	</channel>
</rss>
