Code:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
double sqrt_function (double number);
int main (void)
{
double val;
double p = 0;
printf("input number: ");
scanf("%lf", &val);
p = sqrt_function (val);
printf("\n\n\t%f\n\n", p);
return 0;
}
double sqrt_function (double number)
{
sqrt (number);
return;
}
please, with -Wall and -lm on Debian linux...
Code:
jamie@box6:~/git/square_c$ cc -Wall -lm lost.c
lost.c: In function ‘sqrt_function’:
lost.c:24:2: warning: ‘return’ with no value, in function returning non-void
return;
^~~~~~
lost.c:20:8: note: declared here
double sqrt_function (double number)
^~~~~~~~~~~~~
jamie@box6:~/git/square_c$
code works, what would be a better way to write the sqrt_function?
Thanks!