title: (C Programming) How to find the most frequent occurring digit in long numbers without using array?
body: <p>Input Format:
  A single line that contains an integer.</p>
  <p>Constraint:
  (-) each element &lt;= 9223372036854775807 and &gt;= 0</p>
  <p>Input Sample:
  3214144</p>
  <p>Output Format:
  A single line that contains the most frequent occurring digit. It is guaranteed that there's only one such digit.</p>
  <p>Output Sample:
  4</p>
  <p>Here's the code that I made:</p>
  <pre><code>int main(){
  int input, i=0, num=0;
  do{
      scanf(&quot;%i&quot;, &amp;input);
      i=input%10;   
      break;
  }while(input&lt;= 9223372036854775807 &amp;&amp; input&gt;=0);
  if (i+i==i*2){
      num+=1;
  }
  else{
      num=0;
  }
  if (num&gt;0){
      printf(&quot;%i&quot;, i);
  }
      return 0;
  }
  </code></pre>