title: Faster way to check if number is divisible with specific number
body: <pre><code>#include &lt;iostream&gt;
  
  using namespace std;
  
  int main()
  {
      long long n, k;
  
      cin &gt;&gt; n &gt;&gt; k;
  
      int num, count = 0;
  
      do{
          n--;
          cin &gt;&gt; num;
          if (num &gt; 99 &amp;&amp; (num % 10) % k == 0){
              //cout &lt;&lt; num &lt;&lt; endl;
              count++;
          }
          else if(num &lt; 100 &amp;&amp; (num % k) == 0){
              //cout &lt;&lt; num &lt;&lt; endl;
              count++;
          }
      }while(n);
  
      cout &lt;&lt; count &lt;&lt; endl;
  
      return 0;
  }
  </code></pre>
  
  <p>I'm writing a program to check if a specific number is divisible by specific number inputted by user.</p>
  
  <p>n = amount of numbers inputted
  k = the number to check if numbers are divisible</p>
  
  <p>My program works quite good so far, but it exceeds on time limit. Is there any faster algorithm or code than this to check if a number is divisible with another specific number?</p>
  
  <p>Link : <a href="http://www.codechef.com/problems/INTEST/" rel="nofollow">http://www.codechef.com/problems/INTEST/</a></p>