title: Is there a way to skip a conditional statement in a loop after condition has been satisfied?
body: <p>Suppose we have a <code>bool</code> variable initialized with the value <code>0</code>.This variable is to be used in a loop and turn to 1 once a certain condition has been satisfied.
  Once it acquire the value of 1 it becomes superfluous so is there a way to skip it in a loop for optimization?</p>
  
  <p>My code :</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include &lt;stdbool.h&gt;
  
  int main(void)
  {
      bool var = 0;
      char str[] = "          Hello babz what's up with you?!";
      size_t n, len = strlen(str);
      for (n = 0; n &lt; len; n++) {
          if (str[n] != ' ') {
              var = 1;
          }
          if (var) {
              printf("%c", str[n]);
          }
      }
      putchar('\n');
      return 0;
  }
  </code></pre>