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



Subscribe to Tutorials

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. im having errors in sPort.sendBreak in SerialConne
View Tutorial          By: mrrrc at 2013-03-18 08:54:50

2. lolz what's the code not working in JSP may be sen
View Tutorial          By: lolz at 2008-12-10 03:31:50

3. Can you please tell me what software to be install
View Tutorial          By: Heena Yeole at 2015-03-10 18:05:18

4. Very Very nice explanation...
View Tutorial          By: anil at 2010-11-04 00:22:58

5. I want simple programs using BuffuredReader for m
View Tutorial          By: Why ask my name? at 2013-06-01 04:56:00

6. its very easy to understand and implements.
View Tutorial          By: ashish at 2011-05-20 03:12:07

7. Its really good.....
View Tutorial          By: Shivam at 2009-04-02 03:58:51

8. it is a good example to understand.
View Tutorial          By: nivedha at 2011-07-12 05:15:39

9. It seems author has half knowlage
EJB main

View Tutorial          By: Aryan Siddharth Singh Gautam at 2010-03-22 03:40:11

10. fantastic explaination about XML parsers
View Tutorial          By: smitha at 2011-05-15 04:53:00