title: Caesar Cypher in C giving incorrect output
body: <p>Trying to create a Caesar Cypher in C and getting some troublesome output from lowercase letters that exceed 'z' when shifting letters</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  void confab(const char* inText, int shift, char* outText) 
  {
      int i = 0;
      int j = 0;
      char character = '\0';
      while (inText[i] != '\0') {
          if (inText[i] &gt;= 'A' &amp;&amp; inText[i] &lt;= 'Z') {
              character = inText[i] + shift;
              if (character &gt; 'Z') {
                  character = character - 'Z' + 'A' - 1;
              }
              outText[j] = character;
              j += 1;
          } else if (inText[i] &gt;= 'a' &amp;&amp; inText[i] &lt;= 'z') {
              character = inText[i] + shift;
              if (character &gt; 'z') {
                  character = (character - 'z' + 'a' - 1);
              }
              outText[j] = character;
              j += 1;
          } else {
              outText[j] = inText[i];
              j += 1;
          }
          i += 1;
      }
  }
  
  
  int main(void)
  {
      char buffer[60] = {0};
      char* s = "The quick brown fox jumps over the lazy dog.";
      confab(s, 13, buffer);
      printf("%s\n", buffer);
  }
  </code></pre>
  
  <p>Is giving the output: </p>
  
  <pre><code>Gur d\202vpx oeb\204a sb\205 w\202zc\200 b\203re \201ur yn\207\206 qbt.
  </code></pre>
  
  <p>Instead of:</p>
  
  <pre><code>Gur dhvpx oebja sbk whzcf bire gur ynml qbt.
  </code></pre>
  
  <p>Suspecting my ASCII arithmetic is off in that if statement for the lowercase letters.</p>