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. i've run d program and its works
View Tutorial          By: okeaghala nneka at 2012-03-31 10:58:13

2. very good example...........
View Tutorial          By: debojit dey at 2010-07-20 15:48:38

3. Thanks!! This example was very helpful for me...
View Tutorial          By: Jonathas at 2010-03-11 07:47:51

4. Hi sir !

I have two Crystal Report

View Tutorial          By: Anderson Abad at 2011-07-20 03:34:51

5. can u please explain java scripts for menus.
View Tutorial          By: web designers in kerala at 2011-04-16 02:08:22

6. hi, this is a good example and this rely helpful i
View Tutorial          By: Dhaval PATOLIYA at 2015-09-08 06:55:38

7. Thank you for Very good article.
View Tutorial          By: Pakornsak S at 2010-02-08 04:35:05

8. awesome example
View Tutorial          By: jagjyot singh at 2010-01-12 20:39:04

9. Don't you just love people who all assume we use w
View Tutorial          By: Alan at 2012-08-01 09:10:26

10. i want to study c-programming language
View Tutorial          By: rajesh at 2008-07-27 07:43:09