title: return odd/even number in C with multiple numbers
body: <p>I'm trying to write a program that will take two numbers and depending on their values, return both are odd, both are even, or A is odd and B is even, etc.</p>
  
  <p>I managed to get the program to check one variable but if I add in the second variable I get an output that I don't expect and I can't seem to be able to arrange the code to give the correct output.  I'm guessing that it is a problem with the arrangement of the if/else statements.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main()
  {
      int numA, numB;
      printf("Please enter variables:");
      scanf("%d, %d", &amp;numA, &amp;numB);
      if (numA % 2) {
          printf("Variable A:%d is odd \n",numA);
      }
  else{
      printf("Variable A:%d is even \n", numA);
  }
  if (numB % 2) {
      printf("Variable B:%d is odd \n",numB);
  }
  else{
      printf("Variable B:%d is even \n", numB);
  }
  return 0;
  }
  </code></pre>
  
  <p>The output I get is below</p>
  
  <pre><code>Please enter variables:4 5
  Variable A:4 is even 
  Variable B:32767 is odd 
  </code></pre>
  
  <p>Why is variable B:32767 not 5?</p>
  
  <p>Many thanks for the help as ever.  If I can sort this out, hopefully I can figure out the rest for myself.</p>