title: C# how to break after X times in a loop?
body: <p>shortly, how can i stop the following code after printing 20 numbers?</p>
  
  <p>Thanks</p>
  
  <pre><code>    static void Main(string[] args)
      {
          int num1 = 4;
          int num2 = 7;
  
          for (int i = 200; i &lt; 2000; i++)
          {
              if ((i % num1 == 0) &amp;&amp; (i % num2 ==0))
              {
                  Console.WriteLine(i);
              }
          }
          Console.Read();
      }
  </code></pre>
  
  <p>I tried to write "break" after the "Console.WriteLine(i);" but then it printed only 1 number and i need 20.</p>
  
  <p>Thanks</p>