That is happenig because "j" and "J" are const char []. For exampe "j" is array of chars that c[0]='j' and c[1]='\0'. In C and C++ you can't compare two arrays. it is better to use
strcmp("j","J");
witch is in
When you type
string a="j"
you run constructor in class string. But in class string you have overloaded operator< to compare two strings.