This is a function for checking if the checksum provided by `card[]` is valid. `card[]` contains six pairs of characters. The first five pairs make up a hexadecimal number, and the last pair contains the checksum. The checksum is valid if it is equal to XOR of the first five pairs.

It is working fine, but the code is awful. I was trying to use a nested loop, but it wasn't working. Now I'm getting pairs from `card[]`, converting them into numbers and checking whether the checksum is valid.

```
bool checksum(char card[])
{
int a=0;
char character0[2];
char character1[2];
char character2[2];
char character3[2];
char character4[2];
char character5[2];
long n0,n1,n2,n3,n4,n5;
char card_number;

    for(int i=0;i<2;i++)
    {
        for(a=0;a<2;a++)
        {
        character0[a]=card[i];
        }
    }
    for(int i=2;i<4;i++)
    {
        for(a=0;a<2;a++)
        {
            character1[a]=card[i];
        }
    }
    for(int i=4;i<6;i++)
    {
        for(a=0;a<2;a++)
        {
            character2[a]=card[i];
        }
    }
    for(int i=6;i<8;i++)
    {
        for(a=0;a<2;a++)
        {
            character3[a]=card[i];
        }
    }
    for(int i=8;i<10;i++)
    {
        for(a=0;a<2;a++)
        {
            character4[a]=card[i];
        }
    }
    for(int i=10;i<12;i++)
    {
        for(a=0;a<2;a++)
        {
            character5[a]=card[i];
        }
    }
    n0 = strtol(character0, NULL, 16);
    n1 = strtol(character1, NULL, 16);
    n2 = strtol(character2, NULL, 16);
    n3 = strtol(character3, NULL, 16);
    n4 = strtol(character4, NULL, 16);
    n5 = strtol(character5, NULL, 16);

if(n0^n1^n2^n3^n4==n5)     return true;
else return false;

}

```

The input for the example is "1E00EDE5E5F3", so 1E^00^ED^E5^E5 should be F3.

And something is wrong with this code. I see it now, because

```
if(n0^n1^n2^n3^n4==n5)     return true;
else return false;

```

is working good, but

```
if((n0^n1^n2^n3^n4)==n5))     return true;
else return false;

```

is not working at all.