#include <stdio.h>
#include <string.h>
int crc_sum(char *numt )
{
char i=0;
int sum=0;
char len =strlen(numt);
while(i<4)
{
sum+=numt[i];
i++;
}
return (sum%256);
}
char crc_nsum(char *numt )
{
char i=0;
char sum=0;
char len =strlen(numt);
while(i<4)
{
sum^=numt[i];
i++;
}
return sum;
}
char te[10]={0x11,0x22,0x33,0x44,0x55};
int main()
{
/* Write C code in this online editor and run it. */
printf("Hello, World! \n");
printf("end1:0x%x",crc_sum(te));
printf("end1:0x%x",crc_nsum(te));
return 0;
}
03-11
12-07
1933