title: Value Error (If..else loop)
body: <p>This may be a dumb question but I really don't understand what is the error in this. The program works for all conditions except the condition for <code>A</code>.</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;stdlib.h&gt;
  
  int main(void)
  {
      char card_name[3];
      puts("Enter the card name: ");
      scanf("%2s",card_name);
      int val = 0;
      //printf("%s",card_name);
      if(card_name[0] == 'K') {
          val = 10;
      }
      else if (card_name[0] == 'Q') {
          val = 10;
      }
      else if (card_name[0] == 'J') {
          val = 10;
      }
      else if (card_name[0] == 'A') {
          val == 11;
      }
      else {
          val = atoi(card_name);
      }
  
      printf("The card value is %d",val);
      return 0;
  }
  </code></pre>
  
  <p>The output is correct for all except A.</p>
  
  <pre><code>Enter the card name: A
  The card value is 0
  </code></pre>