title: C - Swap chars using getchar and putchar
body: <p>This is for homework . Must use only getchar and putchar</p>
  
  <pre><code>int main(void) {
  int pch; //first
  int ch; //second
  
  
  while(1){
      pch=getchar();
      ch=getchar();
  
  
      if(((pch&gt;='A' &amp;&amp; pch&lt;='Z')) &amp;&amp; ((ch&gt;='A' &amp;&amp; ch&lt;='Z'))){
          putchar(ch);
          putchar(pch);
      }
  
      if((pch&gt;='A' &amp;&amp; pch&lt;='Z') &amp;&amp; ch=='\n') putchar(pch);
      if(pch=='\n' || ch=='\n') break;
  }
  return EXIT_SUCCESS;
  }
  </code></pre>
  
  <p>I need to swap chars using getchar and putchar . For exemple
  PARIS
  APIRS</p>
  
  <p>And it works , but i need to hit ENTER two times when i even number of letters 4,6,8... . How do i eliminate this behavior ? Is there some way to kill \n for getchar</p>