title: C - strcmp related to an if statement
body: <p>In the code below I use strcmp to compare two strings and make this comparison the condition of an if statement.
  With the code below, the output will be <code>hello world</code>, because string "one" is equal to string "two".</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  
  char one[4] = "abc";
  char two[4] = "abc";
  
  int main() {
  
      if (strcmp(one, two) == 0) {
          printf("hello world\n");
      }
  }
  </code></pre>
  
  <p>Now I want to change the program, and make it print <code>hello world</code> if the two string are different so I change the program that way:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  
  char one[4] = "abc";
  char two[4] = "xyz";
  
  int main() {
  
      if (strcmp(one, two) == 1) {
          printf("hello world\n");
      }
  }
  </code></pre>
  
  <p>I dont understand the reason why it does not print out anything.</p>