title: How to invent a code for square-root?
body: <p>I want to write a code for making square-root not using pow().<br>
  here is what i have tried:  </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  int main(){
      int a,I,sum=0,cnt=0;
      printf("enter number");
      scanf("%d",&amp;a);
      for(I=1;sum&lt;a;I+=2){
          sum+=I;
          cnt++;
      }
      printf("answer is:%d",cnt);
      return 0;
  }
  </code></pre>
  
  <p>for numbers like 4,9,16,... it works but for numbers like 10,17,21,.. it does not work and the result is more than it shoud be.<br>
  what is the problem?</p>