I try to do some hex-bin/bin-hex conversion and test which function would be faster but I encountered strange error while adding 'a' as integer.

```
#include <stdio.h>

/* convert bin to hex char [0-9a-f] */
static inline unsigned char ToHex4bits1(unsigned char znak)
//unsigned char ToHex4bits1(unsigned char znak)
    {
    znak &= 0x0F;
    switch(znak)
        {
        case 10: return 'a';
        case 11: return 'b';
        case 12: return 'c';
        case 13: return 'd';
        case 14: return 'e';
        case 15: return 'f';
        default: return znak + 48;  /// 48  0x30    '0'
        }
    }

/* convert bin to hex char [0-9a-f] */    
static inline unsigned char ToHex4bits2(unsigned char znak)
//unsigned char ToHex4bits2(unsigned char znak)
    {
    //unsigned char add = '0';
    int add = '0';  /// [0-9]; add value of '0' (65 0x41    '0')
    znak &=0x0F;
    if(znak > 9)  /// [a-f]; if `znak' <0x0a, 0x0f> /// just one comparison as `znak' cannot be bigger than 15 anyway (znak &=0x0F;)
        {
        add = 0x61;  /// 'a'; // 87 0x61    'a'
        }
    return znak + add;
    }

//-----------//
int main()
    {
    int i;
    //char z;
    int z; 

    printf("\nToHex4bits1(i)\n");
    for(i=0; i<16; i++)
        {
        z = ToHex4bits1(i);
        printf("%d\t%02x\t%c\n", z, z, z);
        }

    printf("\nToHex4bits2(i)\n");
    for(i=0; i<16; i++)
        {
        z = ToHex4bits2(i);
        printf("%d\t%02x\t%c\n", z, z, z);
        }
    return 0;
    }

```

when I run it `$ gcc -o tohex4bits tohex4bits.c; ./tohex4bits` I get this result:

```
ToHex4bits1(i)
48  30  0
49  31  1
(...)
57  39  9
97  61  a
98  62  b
(...)
102 66  f
48  30  0
# which is what I expected

ToHex4bits2(i)
48  30  0
49  31  1
(...)
57  39  9
107 6b  k # that's where things get interesting; it's 10 too much ('k'-'a'==10)
108 6c  l
109 6d  m
110 6e  n
111 6f  o
112 70  p

# which is wrong

```

What is actually wrong with second function `ToHex4bits2()`, why is that adding 'a' (97/0x61) makes it add 'k' (107/0x6b), or 'A' => 'K' for that matter?