title: C string comparison in an if statement doesn't work
body: <p>I want to compare a previously typed string in an if statement, but it doesn't work. I have tried what explained in this thread: <a href="https://stackoverflow.com/questions/23587574/compare-with-string-in-if-statement-doesnt-work">Compare with string in if statement doesn&#39;t work</a>
  but without luck.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  
  char inputUnit[2];
  float inputValue, returnValue;
  
  int main() {
  
      printf("Enter value to convert: ");
      scanf("%f", &amp;inputValue);
  
      printf("Enter unit to convert: ");
      scanf("%s", inputUnit);
  
      if (strcmp(inputUnit, "in")) {
          returnValue = inputValue * 2.54;
          printf("%.2f %s = %.4f cm\n", inputValue, inputUnit, returnValue);
      }
  }
  return (0);
  </code></pre>
  
  <p>So, what I did wrong?
  Thanks.</p>