You have already received several responses to manipulations. Here is something else.
In C, arr[ind] == *(arr + ind) . This allows us to confuse (but legal) things a bit, such as int arr = { 3, 1, 4, 5 }; int val = 0[arr]; int arr = { 3, 1, 4, 5 }; int val = 0[arr]; .
Thus, we can define a custom add function (without explicitly using the arithmetic operator):
unsigned int add(unsigned int const a, unsigned int const b) { char * const aPtr = (char *)a; return (int) &(aPtr[b]); }
Alternatively, if we want to avoid this trick, and if by the arithmetic operator they include | , & and ^ (therefore, direct bit manipulation is not allowed), we can do this through the lookup table:
typedef unsigned char byte; const byte lut_add_mod_256[256][256] = { { 0, 1, 2, , 255 }, { 1, 2, , 255, 0 }, { 2, , 255, 0, 1 }, { 254, 255, 0, 1, , 253 }, { 255, 0, 1, , 253, 254 }, }; const byte lut_add_carry_256[256][256] = { { 0, 0, 0, , 0 }, { 0, 0, , 0, 1 }, { 0, , 0, 1, 1 }, { 0, 0, 1, , 1 }, { 0, 1, 1, , 1 }, }; void add_byte(byte const a, byte const b, byte * const sum, byte * const carry) { *sum = lut_add_mod_256[a][b]; *carry = lut_add_carry_256[a][b]; } unsigned int add(unsigned int a, unsigned int b) { unsigned int sum; unsigned int carry; byte * const aBytes = (byte *) &a; byte * const bBytes = (byte *) &b; byte * const sumBytes = (byte *) ∑ byte * const carryBytes = (byte *) &carry; byte const test[4] = { 0x12, 0x34, 0x56, 0x78 }; byte BYTE_0, BYTE_1, BYTE_2, BYTE_3; if (0x12345678 == *(unsigned int *)test) { BYTE_0 = 3; BYTE_1 = 2; BYTE_2 = 1; BYTE_3 = 0; } else { BYTE_0 = 0; BYTE_1 = 1; BYTE_2 = 2; BYTE_3 = 3; } add_byte(aBytes[BYTE_0], bBytes[BYTE_0], &sumBytes[BYTE_0], &carryBytes[BYTE_0]); add_byte(aBytes[BYTE_1], bBytes[BYTE_1], &sumBytes[BYTE_1], &carryBytes[BYTE_1]); if (carryBytes[BYTE_0] == 1) { if (sumBytes[BYTE_1] == 255) { sumBytes[BYTE_1] = 0; carryBytes[BYTE_1] = 1; } else { add_byte(sumBytes[BYTE_1], 1, &sumBytes[BYTE_1], &carryBytes[BYTE_0]); } } add_byte(aBytes[BYTE_2], bBytes[BYTE_2], &sumBytes[BYTE_2], &carryBytes[BYTE_2]); if (carryBytes[BYTE_1] == 1) { if (sumBytes[BYTE_2] == 255) { sumBytes[BYTE_2] = 0; carryBytes[BYTE_2] = 1; } else { add_byte(sumBytes[BYTE_2], 1, &sumBytes[BYTE_2], &carryBytes[BYTE_1]); } } add_byte(aBytes[BYTE_3], bBytes[BYTE_3], &sumBytes[BYTE_3], &carryBytes[BYTE_3]); if (carryBytes[BYTE_2] == 1) { if (sumBytes[BYTE_3] == 255) { sumBytes[BYTE_3] = 0; carryBytes[BYTE_3] = 1; } else { add_byte(sumBytes[BYTE_3], 1, &sumBytes[BYTE_3], &carryBytes[BYTE_2]); } } return sum; }