title: Why does my code calling a function twice?
body: <pre><code>    #include &lt;stdio.h&gt;
  int bolucu(int n){
  int temp;
  temp=n;
  int basamak=0;
  while(temp != 0){
      temp/=10;
      ++basamak;
  }
  int digits = 0;
  int m = n;
  while (m) {
      digits++;
      m /= 10;
  }
  digits /= 2;
  int tmp = 0, lower_half = 0;
  while (digits--) {
      tmp *= 10;
      tmp += n % 10;
      n /= 10;
  }
  while (tmp) {
      lower_half *= 10;
      lower_half += tmp % 10;
      tmp /= 10;
  }
  if (basamak % 2==1){
      n/=10;
  }
  int a;
  int b;
  a = n;
  b=lower_half;
  printf(&quot;%d %d\n&quot;,a,b);
  int loopTemp;
  for(int i=0;i&lt;10;i++){
      a=3*a+2;
      b=2*b+3;
      if(a&gt;b){
          temp=a;
          a=b;
          b=temp;
      }
      if(a==b){
          printf(&quot;Congratulations you caught one!!!\n&quot;);
          return 1;
          break;
      }
  }
  if(a!=b){
      printf(&quot;10 tries were not enough!\n&quot;);
      return 2;
  }
  }
  int main()
  {
      int number;
      printf(&quot;\nEnter a number with at least two digits: &quot;);
      scanf(&quot;%d&quot;,&amp;number);
      bolucu(number);
      while(bolucu(number) != 1){
      printf(&quot;\nEnter a new number: &quot;);
      scanf(&quot;%d&quot;,&amp;number);
      printf(&quot;%d&quot;,bolucu(number));
      }
      return 0;
  }
  </code></pre>
  <p>e.g:
  <a href="https://i.stack.imgur.com/Xtxh1.png" rel="nofollow noreferrer">This is terminal screen.</a></p>
  <p>As you can see there is a second one. First one is true but i don't want second one.
  How can i get rid of the second calling?
  (Also sorry for bad code writing, i'm new)
  What im missing here?
  And i cant use any library other than stdio.(Like math.h)</p>