Search : in
By :

C progam

Last answer on Nov 6, 2009 7:12:56 am GMT saqi, on Nov 6, 2009 4:47:30 am GMT 
 Report this message to moderators

Hello,
how to make a fibonacci series

Configuration: Windows 2003
Firefox 3.0.5

Best answers for « c progam » in :
Change the default installation folder C: \ Program Files Show Change the default installation folder C: \ Program Files The installation of most software programs are set by default in the C: \ Program Files. Below is a means of how to change into another partition. Under Windows Vista, select...
Error loading C:\PROGRA~1\MYWEBS~1\bar\5.bin\M3PLUGIN>DLL Show Error loading C:\PROGRA~1\MYWEBS~1\bar\5.bin\M3PLUGIN>DLL Issue Solution Note Issue I need help for error Error loading C:\PROGRA~1\MYWEBS~1\bar\5.bin\M3PLUGIN>DLL Solution To solve: Please click on Start, Click on Run and type the...
Compiling a program in C with Dev C++ on Vista ShowCompiling a program in C with Dev C++ on Vista Compiling a C source code under Vista with Dev C++, can be a quite difficult procedure. Quick solution: the g++ compiler To be used with Dev-PSV: Go to Tools/compiler options and...
[C Language] finding the square root of a number Show[C Language] finding the square root of a number Intro Notes Intro A simple C program allowing you to find the square root of a number. #include #include int main(void) { double x = 4.0, result;...
A dialect for C language ShowA dialect for C language Cyclone language Conclusion You want to do some C programming but the fact that C embedded automatic Garbage Collector will make debugging harder and is not quite effective when making system programming, such...
Programming languages - Instructions ShowFramework The term "Application Framework" describes an API structured set, which is organised within an executable environment. The term "Application Framework" is generally shortened to just "Framework".
IP Address ShowWhat is an IP address? Computers communicate over the Internet using the IP protocol (Internet Protocol), which uses numerical addresses, called IP addresses, made up of four whole numbers (4 bytes) between 0 and 255 and written in the format...
Environment variables ShowEnvironment variables An environment variable is a dynamic value loaded into the memory that can be used by several processes operating simultaneously. On most operating systems, the location of some libraries or of the main system executables may...

1

 iveal, on Nov 6, 2009 7:12:56 am GMT

Dear Saqi,

Please consider going through the following sample and

hence have the solution of your problem.

#include<iostream>
using namespace std;
int fibonacci(int n)
{
int x1 = 0, fib;
int x2 = 1;
if(n >= 1)
{
for(int i=2;i<= n; i++)
{
fib = x1+ x2;
x1 = x2;
x2 = fib;
}}
return fib;
}
int main(){
for(int i=2;i<=10;i++) {
cout<<fibonacci(i)<<endl;
}
return 0;
}

Hope that the information provided proves useful to you.

Thank you.

Reply to iveal