[Solved] Got stuck with Caesar.c


A function to caesar an alphabetic char should be like (decomposed in elementary steps):

int caesar_lower(int c,int key) {
    int v = c-'a'; // translate 'a'--'z' to 0--25
    v = v+key;     // translate 0--25 to key--key+25
    v = v%26;      // translate key--key+25 to key--25,0--key-1
    v = v+'a';     // translate back 0--25 to 'a'--'z'
    return v;
}

4

solved Got stuck with Caesar.c