How to solve the math equation y = x ^ (a / b) - 1 in C

1 Answer

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

// y = x ^ (a / b) - 1

double f(int x, int a, int b) {
    return pow(x, (a / b )) - 1;
} 
 
int main(void)
{
    printf("%lf\n", f(8, 9, 3));
   
    return 0;
}
 

 
/*
run:
 
511.000000

*/

 



answered Aug 7, 2024 by avibootz
...