title: Caesar's Cipher Code
body: <pre><code>#include &lt;stdio.h&gt;
  
  void caesar (char cipher[], int shift);
  
  int main () {
  
  char cipher[50];
  int shift;
  
    printf("Enter text to be encrypted IN CAPITAL LETTERS ONLY: ");
    scanf("%s", cipher);
  
    printf("How many shifts do you prefer? 1-10 only: ");
    scanf("%d", &amp;shift);
  
    caesar (cipher, shift);
  
    return 0;
  }
  
  void caesar (char cipher[], int shift) {
    int i = 0;
  
    while (cipher[i] != '\0') {
      if ((cipher[i] += shift) &gt;= 65 &amp;&amp; (cipher[i] += shift) &lt;= 90) {
        cipher[i] += (shift);
      } else {
        cipher[i] += (shift - 25); 
      }
      i++;
    }
    printf("%s", cipher);
  }
  </code></pre>
  
  <p><strong>I'm starting to get encrypted outputs but i'm afraid there's something wrong with my statements.</strong></p>
  
  <p><em>For Example:</em></p>
  
  <ul>
  <li><em>Input: ABCD, 1 shift</em></li>
  <li><em>Output: DEFG</em> &lt;= which is actually 3 shifts.</li>
  </ul>