### Function help

Hey guys,

Just started learning about functions and attempted a problem from a textbook; "Write a function cube_root that receives a double argument and calculates and returns an approximate cube root for it. You should also write a main program that allows you to test your function"

I tried, and subsequently failed. Any help as to where I went wrong?

 ``12345678910111213141516171819202122232425262728293031323334353637383940414243444546`` ``````#include #include #include #define MAX_VALUE 1e+6 #define MIN_VALUE 1e-6 #define MAX_LOOP 25 double cbrt(double input); int main(int argc, char *argv[]){ int input; printf("Enter a number to be cube rooted:"); scanf("%d", input); printf("The resulting cube root is: %d", cbrt(input)); return 0; } double cbrt(double input){ int i; double solution; double x = 1.0; if (MIN_VALUE>input || MAX_VALUE

Program crashes when I enter anything. Thanks.
Use

scanf("%d", &input);

Like that: `scanf("%d", &input);`
` printf("The resulting cube root is: %f", cbrt(input));`
 `(2+input)/3`