title: How do I fix my if statement not being recognized as true
body: <p>I wrote my program that is supposed to check if someone is single, married (either separated or joint) and if they were the head of the house hold in order to calculate the taxes they have to pay. For some reason when i type y for the first scanf the next if statement gets skipped. Please help! Here is my whole code. I know it is not the most optimized and they I could clean it up but I'm just trying to figure out what is wrong with it first.</p>
  
  <pre><code>    void question3 (void)
      {
      char single, head, joint;
      int income = 0;
      double tax = 0;
  
      printf("What is your total income?");
      scanf("%d", &amp;income);
  
      printf ("Are you single? (y/n) \n");
      scanf (" %c", &amp;single);
  
      if (single == 'y')
      {
          if (income == 17850)
          {
              tax = income * .15;
          }
          else if (income &gt;= 17850)
          {
              tax = ((.15 * 17850) + (.28 * (income - 17850)));
          }
      }
      else
      {
          if (single != 'y')
          {
          printf("Are you the head of the house hold? y or n\n");
          scanf(" %c", &amp;head);
          }
      }
  
      if (head == 'y')
      {
          if (income == 23900)
          {
           tax = income * .15;
          }
          else if (income &gt;= 23900)
          {
           tax = ((.15 * 23900) + (.28 * (income - 23900)));
          }
      }
      else if (head != 'y')
      {
          printf("Do you have a joint marriage\n");
          scanf(" %c", &amp;joint);
      }
  
      if (joint == 'y')
      {
          if (income == 29750)
          {
           tax = income * .15;
          }
          else if (income &gt;= 29750)
          {
          tax = ((.15 * 29750) + (.28 * (income - 29750)));
          }
      }
      else if (joint != 'y')
      {
          if(income == 14875)
          {
           tax = income * .15;
          }
          else if (income &gt;= 14875)
          {
           tax = ((.15 * 14875) + (.28 * (income - 14875)));
          }
  
      }
  
      printf("You owe %f dollars in taxes.", tax);
      }
  </code></pre>