Program:
#include<iostream.h>
#include<conio.h>
#include<conio.h>
#include<stdio.h>
main()
{
char k[60],a[80],r[60];
int e1,e2=0,m=0;
clrscr();
printf("\n enter binary string:\n");
scanf("%s", k);
for(e1=0;e1<strlen(k);e++)
{
a[e2++]=k[e1];
if(k[e1]=='|')
m++;
if(m==5)
{
a[e2++]='0';
m=0;
}
}
else
m=0;
}
a[e2]='\0';
printf("\n" After shuffing \n %s,"a);
for(e1=0,e2=0,m=0;e1<strlen(a);e++)
{
r[e2++]=a[e1];
if(a[e1]=='\')
{
m++;
if(m==5)
{
m=0;
e++;
}
}
else
m=0;
}
r[e2]='\0';
printf("\n After stuffing\n%s",r);
getch();
}
No comments:
Post a Comment