title: Encryption with swapping letters in C
body: <p>I need to write a program that reads from the input a sentence terminated by a new line. The program should write an encryption of the sentence in a way that the letter 'a' is swapped with 'z', 'b' with 'y' and so on. I am not supposed to use arrays, that is why I can't find a solution for this problem.</p>
  
  <p>This is my code:</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  
  int main() {
      char alphabet, temp;
      while( scanf("%c", &amp;alphabet) != '\n') {
          for(char i ='a', j='z'; i &lt;= 'z', j&gt;='a'; i++, j--) {
              if(alphabet == i) {
                  temp = j;     
              }     
          }   
          printf("%c", temp);  
      }
      return 0;
  }
  </code></pre>
  
  <p>When I input: abc as an output I get zyxxxxxxxxxxxxxxxxxxxxxxxxx(an infinite number of x).</p>
  
  <p>So to sum up:
  Input:abc. Output: zyxxxxx(infinite number of x).</p>