Friday , December 15 2017
Home / Tag Archives: Cyclic Redundancy Code

Tag Archives: Cyclic Redundancy Code

C Program to implement CRC (Cyclic Redundancy Code)

Cyclic Redundancy Code

This is a C Program for implementing CRC (Cyclic Redundancy Check Code) #include <stdio.h> #include <conio.h> #include <string.h> void main() { int i,j,keylen,msglen; char input[100], key[30],temp[30],quot[100],rem[30],key1[30]; clrscr(); printf("Enter Data: "); gets(input); printf("Enter Key: "); gets(key); keylen=strlen(key); msglen=strlen(input); strcpy(key1,key); for(i=0;i<keylen-1;i++) { input[msglen+i]='0'; } for(i=0;i<keylen;i++) temp[i]=input[i]; for(i=0;i<msglen;i++) { quot[i]=temp[0]; if(quot[i]=='0') for(j=0;j<keylen;j++) key[j]='0'; else for(j=0;j<keylen;j++) key[j]=key1[j]; for(j=keylen-1;j>0;j--) { if(temp[j]==key[j]) rem[j-1]='0'; else rem[j-1]='1'; } ...

Read More »