How to computes the cubic root in C

3 Answers

0 votes
#include <stdio.h>
#include <math.h>

int main(void)
{
    double d = cbrt(729);

    printf("%lf", d);

}






/*
run:

9.000000

*/

 



answered Jan 26, 2023 by avibootz
0 votes
#include <stdio.h>
#include <math.h>

int main(void)
{
    float f = cbrtf(512);

    printf("%f", f);
}






/*
run:

8.000000

*/

 



answered Jan 26, 2023 by avibootz
0 votes
#include <stdio.h>
#include <math.h>

int main(void)
{
    long double ld = cbrtl(1331);

    printf("%Lf", ld);
}






/*
run:

11.000000

*/

 



answered Jan 26, 2023 by avibootz

Related questions

1 answer 157 views
1 answer 152 views
1 answer 182 views
1 answer 152 views
1 answer 126 views
...