Skip to content

Instantly share code, notes, and snippets.

@samir96
Created April 10, 2015 02:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samir96/2a7a0ae5dc758a5a481f to your computer and use it in GitHub Desktop.
Save samir96/2a7a0ae5dc758a5a481f to your computer and use it in GitHub Desktop.
#include <iostream>
using namespace std;
float raizcuadrada(double x){
float raiz = x, c = 0;
while (c != c){
c = raiz;
raiz = (x/ + c)/2;
}
return raiz;
}
int main(){
float num;
cout << "dame un numero del cual quieras saber su raiz cuadrada: " << endl;
cin >> num;
cout << "The square root is : " << raizcuadrada(num) << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment