1 Answers
p54.c:19: warning: implicit declaration of function `fibonacci' in gcc?
Asked by: forexsheet 115 views
when ii try to compile this small c program i get : p54.c:19: warning: implicit declaration of function `fibonacci’
what did i do wrong?
/***************************************************************************/
int main ( int argc, char *argv[ ] ) {
int n ;
printf("\nplease enter a number\n") ;
fibonacci(n);
return 0 ;
}
int fibonacci(int n) {
int c =0 ;
int d =1 ;
int sum ;
int i ;
for(i = 0 ; i < n ; i++) {
printf("%d\n",c) ;
sum = c + d ;
c = d ;
d = sum ;
}
return 0 ;
}
Tags: amp, argv, c program, Forex, implicit declaration of function, int argc, int c, lt, printf, scanf, stdio