title: palindrome just using loops in C
body: <p>I used following code..but i am looking for proper condition to put. please help me out with it.</p>
  
  <pre><code>int main(){
      int k = 0;
      char a[9] = {'\0'}, b[9] = {'\0'};
  
      printf("enter string \n");
      gets(a);
      int p = strlen(a);
  
      for(int i = p-1; i &gt;= 0; i--){
          b[k] = a[i];
          k = k+1;
      }
  
      for(int j = 0; j &lt; p; j++){
          if(a[j] == b[j]){
              continue;
          }else
              printf("not pal");
  
          break;
      }
      return 0;
  }
  </code></pre>