r/cprogramming • u/[deleted] • Jul 05 '22
What's wrong with my program, I get nothing in the end :/
2
Upvotes
10
u/sk3tChY21 Jul 05 '22
Your ln function returns the answer but you aren't storing it in a variable or printing it to the screen.
3
u/Kayin-Chu Jul 05 '22 edited Jul 05 '22
you called the function, but not printed its return value.
printf("result : lf\n", ln(x));or
double result = ln(x);
printf("result : lf\n", result);1



3
u/shut_up_if_your_dumb Jul 05 '22
The function ln(x) returns the solution but you are ignoring the return value. You can use printf to see the return value like this:
printf("%f", ln(x));