title: Do I understand correctly the way logical AND works?
body: <p>I have a simple homework assignment: Write a script that prints all the numbers from 1 to N, that are not divisible by 3 and 7 at the same time.</p>
  
  <p>So, here is my solution. The way it works - it prints all numbers that divide by 3 OR by 7 instead of 3 AND 7. Please help me understand why is this not working as I need. Here is the code:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;Loops - Task 2&lt;/title&gt;
  &lt;link href="js-console.css" rel="stylesheet" /&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;label for="input_num"&gt;Start: &lt;/label&gt;
      &lt;input type="text" id="input_num" /&gt;
  
      &lt;a href="#" id="btn" onclick="printNums()"&gt;Print numbers&lt;/a&gt;
  
      &lt;div id="js-console"&gt;&lt;/div&gt;              
      &lt;script src="js-console.js"&gt;&lt;/script&gt;
      &lt;script&gt;
          var input_num;
          var counter;
          function printNums(){
              input_num = jsConsole.readInteger("#input_num");
              for (counter=1; counter&lt;=input_num; counter++){
                  if(counter % 3 !=0 &amp;&amp; counter % 7 != 0){
                      jsConsole.writeLine(counter);
                  }
                }
      }
      &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>