title: Check the command line arguments for a negative number
body: <p>I am trying to figure out how to detect the negative numbers in argc (in c).</p>
  
  <p>Code:</p>
  
  <pre><code>int main(int argc, char *argv[]){
      printf("\n");
      for(int i = 0; i &lt; argc; i++){
          printf("%s\n", argv[i]); //print what typed in the command line (arguments)
          //do an if statement here? if less than zero, any help would be great.
      } 
  }
  </code></pre>
  
  <p>I am thinking where I am struggling with the if statement (hopefully I am on track). Any suggestion? Thanks.</p>
  
  <p>The output I am expecting:</p>
  
  <pre><code>$ ./a.out 5 4 6 3 5 -5
  5
  4
  6
  3
  5
  -5
  Sorry, you have negative value. 
  </code></pre>
  
  <p>Then it will quit the program.</p>
  
  <p>Thanks.</p>