title: Program that calculates square roots of a number.
body: <p>I have to make a program, which takes in a number and outputs the square root of it. Ex - 45 --> 3√5. I made a program, but it just returns the same number that i put in. Help would be greatly appreciated.
  Here's my code --></p>
  
  <pre><code>#include&lt;iostream&gt;
  using namespace std;
  
  
  int squarerootfinder(int number, int divisor){
       if(divisor == 1){
  
              return 1;
       }
       else{
  
              if((number / (divisor * divisor))% 1 != 0){
  
                      divisor = squarerootfinder(number, divisor - 1);
  
              }
              if((number/ (divisor * divisor)) % 1 == 0 ){
              return divisor;
  
              }
  
        }
  
  }
  int main(){
       int number;
       cout &lt;&lt; "Enter a number to find the square root of it \n";
       cin &gt;&gt; number;
       int divisor = number;
       int squareroot;
       squareroot = squarerootfinder(number, divisor);
       cout &lt;&lt; squareroot &lt;&lt; endl;
       return 0;
  }
  </code></pre>