Comment on Tutorial - C++ Recursion function explained using Fibonacci series By Emiley J



Comment Added by : Tahani

Comment Added at : 2011-04-26 11:55:34

Comment on Tutorial : C++ Recursion function explained using Fibonacci series By Emiley J
my answer for this Question is :

#include <iostream>
using namespcae std;

in fib (int n)
{
if (n==0)
return 1;
else
return fib(n-1)+fib(n-2);
}


int main()
{
int x;
cout<<"please enter a number"<<endl;
cin>>x;
cout<<"The fibonacci of "<<x<<"is"<<fib(x);

return 0;
}


View Tutorial



Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. practical example of funcation overloding
View Tutorial          By: yogesh at 2010-12-19 08:39:06

2. @3
argc simply means the argument count.
View Tutorial          By: CDub at 2010-02-22 09:32:54

3. please explain importance of java and explain it's
View Tutorial          By: sandhi.vijayanth reddy at 2012-10-01 16:30:54

4. good
View Tutorial          By: [email protected] at 2014-08-28 14:02:28

5. Hi Shreya, in Linux, the COM ports are identified
View Tutorial          By: Ramlak at 2008-06-23 03:34:11

6. Thankx, the information was of great use, I apprec
View Tutorial          By: sachin at 2008-12-13 03:37:11

7. the reason for this is quite simple: java expands
View Tutorial          By: vineeth at 2011-08-25 13:54:37

8. its useful code.
but i want to write in a f

View Tutorial          By: SARWAR at 2011-08-02 06:26:37

9. I am using VS2010 & SAP for crystal report. I
View Tutorial          By: Abdullah Al Mamun at 2011-08-11 23:20:37

10. I've been learning C++/C for the past year or so,
View Tutorial          By: William Semple at 2013-01-05 17:53:30