|
|
|
|
Ça c'est pour la version C. En C++ :
#include <cmath>
#include <iostream>
int main(){
unsigned n = 9;
std::cout << "sqrt(" << n << ") = " << sqrt(n) << std::endl;
return 0;
}
Pour la version en C, pense à compiler avec la librairie math : gcc -W -Wall -o mon_executable plop.c -lm En C++ apparemment ce n'est pas indispensable : g++ -W -Wall -o mon_executable plop.c Bonne chance |
C bon g trouvez sur un forum comment ca marche le sqrt en fait c simple:
|