#include // 1 2 3 4 2 4 6 0 12 int main(void){ int b[] = {1, 2, 3, 4, 2, 4, 6, 0, 12}; printf("%u\n", normalChecksum(b, 9)); return 0; } int normalChecksum(int *b, int n){ int i; int a, bb; for(i = 1, a = 0; i < n; i++) a+=(int)b[i]; bb = a / 256; a = (a - 256 * bb) + bb; bb = a / 256; return (int)((a-256*bb)+bb); }