Free Academic Seminars And Projects Reports
Program to implement the data link layer framing method character stuffing - Printable Version

+- Free Academic Seminars And Projects Reports (https://easyreport.in)
+-- Forum: Academic (https://easyreport.in/forumdisplay.php?fid=41)
+--- Forum: Study guide (https://easyreport.in/forumdisplay.php?fid=63)
+---- Forum: Technical (https://easyreport.in/forumdisplay.php?fid=64)
+---- Thread: Program to implement the data link layer framing method character stuffing (/showthread.php?tid=42869)



Program to implement the data link layer framing method character stuffing - SHAJAHAN - 10-04-2017

Code:
#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
int i,j,k,n,c=0,l;
char s[20];
clrscr();
printf("\t enter the string \n\t");
gets(s);
l=strlen(s);
printf("\t%d",l);
printf("\n\n");
j=0;
printf(" \tenter the frame size: \t ");
scanf("%d",&n);
k=l/n;
for(i=0;i<k;i++)
{
printf("\t DLESTX");
while(j<l)
{

putchar(s[j]);
c++;
j++;
if(c==n)
break;
}
printf(" DLESTX \t");
printf("\n\n");
c=0;
}
getch();