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
- Data Science
- Android
- AJAX
- ASP.net
- C
- C++
- C#
- Cocoa
- Cloud Computing
- HTML5
- Java
- Javascript
- JSF
- JSP
- J2ME
- Java Beans
- EJB
- JDBC
- Linux
- Mac OS X
- iPhone
- MySQL
- Office 365
- Perl
- PHP
- Python
- Ruby
- VB.net
- Hibernate
- Struts
- SAP
- Trends
- Tech Reviews
- WebServices
- XML
- Certification
- Interview
categories
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
Count number of vowels, consonants and digits in a String in Java
Student marks calculation program 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
Archived Comments
1. HI.KEEP ME ON WORK I HAVE MASTER PROGRAMMING C++ <
View Tutorial By: NINHNGUYEN at 2011-06-19 12:54:20
2. lots of thanks for this given example........hope
View Tutorial By: virgi crisostomo at 2010-08-18 17:18:08
3. Nice Example.Good work.keep it up.
Thanks,<
View Tutorial By: Lucky at 2011-07-08 10:36:38
4. thanks for giving the example of abstract class...
View Tutorial By: mahesh at 2010-04-11 08:20:45
5. Thanks bro...you save me from a great problem...ve
View Tutorial By: Tishan at 2012-07-09 09:14:07
6. I don't think GSM/Modem simulatur, will get it wor
View Tutorial By: Michael Chon at 2008-10-08 10:35:55
7. This code is only for send sms? can it also alert
View Tutorial By: abdul kadir at 2009-10-23 05:37:46
8. Hi Sir,
Thank You so much for your
View Tutorial By: kareena at 2010-10-21 23:26:37
9. where's your main sir?
View Tutorial By: armor at 2010-12-08 01:00:45
10. I want simple programs using BuffuredReader for m
View Tutorial By: Why ask my name? at 2013-06-01 04:56:00