Caesar Cipher Encryption giving wrong output
<p>Whenever I input string such as Dizzy with key 10 for example the output is partially wrong. I am having something like this ===><code>ns���</code> while I should have <code>nsjji</code>.</p>

<pre class="lang-cpp prettyprint-override"><code>Serial.print("KEY: ");
Serial.println(k);

if ((choice[0]=='e') || (choice[0]=='E')){

    int i;
    char ch;                                        

    for (i=0; str[i] != '\0'; i++){

        ch=str[i];

        if( ch &gt;= 'a' &amp;&amp; ch &lt;= 'z'){

            ch=ch+k;

            if (ch &gt;'z'){
                ch=ch-'z'+'a'-1;
            } 

            str[i]=ch;
        }   
        else if(ch &gt;='A' &amp;&amp; ch &lt;= 'Z'){  

            ch=ch+k;

            if (ch &gt; 'Z'){
                ch=ch-'Z'+'A'-1;
            } 
            str[i]=ch;
        } 
    }

    Serial.print("encrypt: ");
    Serial.println(str);
</code></pre>