+ 2
How to find cube root without using library function in c programming? (Please ! Comment the code)
SAMPLE 1:- INPUT: 8 OUTPUT: 2 SAMPLE 2:- INPUT: 12 OUTPUT: 2.2894
2 Respostas
+ 3
JAY AJ
Use cbrt() function or pow() function.
for cbrt() follow this :
https://www.programiz.com/c-programming/library-function/math.h/cbrt
If you want to use pow function :
double a=8;
double cube_root=pow(b, 1.0/3);
printf("%lf",cube_root);
and for using either of them you'll need to include math.h header.