/* Fibonacci by Recursion */ #include<stdio.h> int fib(int); int main() { printf("Type any value : "); printf("\nNth value: %d",fib(getche()-'0')); return 0; } int fib(int n) { if(n<=1) return n; return(fib(n-1)+fib(n-2)); }
In function 'fib':Line 13: error: 'x' undeclared (first use in this function)Line 13: error: (Each undeclared identifier is reported only onceLine 13: error: for each function it appears in.
check it now !!!
oh, I forgot to include conio.h
Only OK
The program is compiled successfully but as we run the program its returning the same number we asked for series
write a program to clear screen with out using clrscr();funtion
In function 'fib':
ReplyDeleteLine 13: error: 'x' undeclared (first use in this function)
Line 13: error: (Each undeclared identifier is reported only once
Line 13: error: for each function it appears in.
check it now !!!
Deleteoh, I forgot to include conio.h
ReplyDeleteOnly OK
ReplyDeleteThe program is compiled successfully but as we run the program its returning the same number we asked for series
ReplyDeletewrite a program to clear screen with out using clrscr();
ReplyDeletefuntion