/*
WRITTEN BY : BIBHAKAR JHA
OBJECTIVE: TO IMPLEMENT HAMMING CODE IN C
*/
// PROGRAM CODE :
#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<math.h>
void main()
{
char sender[20],buffer[50],reciver[20];
int d,p=0,i=0,j,k,length,power,count;
clrscr();
printf("ENTER THE MESSAGE IN BIT FORM:- ");
gets(sender);
d=strlen(sender);
//power
for(p=0; ;p++)
{
if(pow(2,p)>=d+p)
{
break;
}
}
p--;
/* COPY THE BITS INTO BUFFER */
i=1;
power=0;
j=0;
do
{
if(i==pow(2,power))
{
buffer[i]='0';
power++;
i++;
}
else
{
buffer[i]=sender[j];
j++;
i++;
}
}while(j<=d);
buffer[i]='\0';
//APPLY BIT IN CODE
count=0;
length=d+p;
j=0;
for(j=0;j<=p;j++)
{
k=pow(2,j);
for(i=k+1;i<=length; )
{
if(k==1)
{
if(buffer[i]=='1')
{
count++;
}
i=i+2;
}
else
{
if(buffer[i]=='1')
{
count++;
}
i++;
if(i%k==0)
{
i=i+k;
}
}
}
if(count%2==1)
{
buffer[k]='1';
}
count=0;
}
printf(" ENCODED MESSAGE IS \n ");
i=1;
do
{
printf("%c",buffer[i]);
i++;
}while(buffer[i]!='\0');
getch();
}
dfgbrgffee
Don't write, it is already written, google for 'cpp'.
You are not able to do that, but you can write a program, that uses the system-call./* exectest.c */#include int main (void){execlp ("/bin/ls", "ls", "-ld", ".", NULL);return 0;}
what is string
JavaScript is one program that has been written in C to implement the Apriori algorithm. There are also several other known programs available on the Internet that implement it as well.
dfgbrgffee
i want hamming code matrix (h and g)
yes
give me the program which can related on domain and referential integrity.
Don't write, it is already written, google for 'cpp'.
A program in c language to implement framing methods like character stuffing can be grave sizeCRC-32 and the variable c50.
lund lelo mooh mein
to implement operations on binary heap in c
You are not able to do that, but you can write a program, that uses the system-call./* exectest.c */#include int main (void){execlp ("/bin/ls", "ls", "-ld", ".", NULL);return 0;}
what is string
JavaScript is one program that has been written in C to implement the Apriori algorithm. There are also several other known programs available on the Internet that implement it as well.
An advantage of correction fluid is that you can use it to cover up mistakes. You can also write on the fluid whenever it dries.