answersLogoWhite

0


Best Answer

You can write a C++ fib pro using arrays but the problem is the prog becomes very complicated since u need to pass the next adding value in an array.....

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Would you Write c plus plus program using array for Fibonacci number?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Write a java program to print the last digit in Fibonacci series?

Just generate the Fibonacci numbers one by one, and print each number's last digit ie number%10.


Write a program to print the Fibonacci series in php upto input value using recursive function?

The Fibonacci sequence uses recursion to derive answers. It is defined as: F0 = 0 F1 = 1 Fn = F(n - 1) + F(n -2) To have this sequence printed by a php script use the following: function fibonacci($n) { if($n 1) return 1; //F1 else return fibonacci($n - 1) + fibonacci($n - 2); //Fn } This recursive function will print out the Fibonacci number for the integer n. To make it print out all the numbers in a particular set add this to your script. for($i = 0; $i < 15; $i++) { echo fibonacci($i) . "<br />"; } So your final result would look like. <?php function fibonacci($n) { if($n 1) return 1; else return fibonacci($n - 1) + fibonacci($n - 2); } for($i = 0; $i < 15; $i++) { echo fibonacci($i) . "<br />"; } ?>


Write a c program to generate Fibonacci series using copy constructor?

#include #include void main(void) { int i,j,k,n; clrscr(); i=0; j=1; printf("%d %d ",i,j); for(n=0;n<=5;n++) { k=i+j; i=j; j=k; printf("%d ",k); } getch(); }


How do you write a c program to convert binary to decimal by using while statement?

write a c++ program to convert binary number to decimal number by using while statement


Write a program that read phrase and print the number of lower-case letter in it using function of counting?

write a program that reads a phrase and prints the number of lowercase latters in it using a function for counting? in C program

Related questions

Write a c program Fibonacci series using for loop in java?

Exactly what do you mean by 'C program in Java'


Write a java program to print the last digit in Fibonacci series?

Just generate the Fibonacci numbers one by one, and print each number's last digit ie number%10.


Write a program to print the Fibonacci series in php upto input value using recursive function?

The Fibonacci sequence uses recursion to derive answers. It is defined as: F0 = 0 F1 = 1 Fn = F(n - 1) + F(n -2) To have this sequence printed by a php script use the following: function fibonacci($n) { if($n 1) return 1; //F1 else return fibonacci($n - 1) + fibonacci($n - 2); //Fn } This recursive function will print out the Fibonacci number for the integer n. To make it print out all the numbers in a particular set add this to your script. for($i = 0; $i < 15; $i++) { echo fibonacci($i) . "<br />"; } So your final result would look like. <?php function fibonacci($n) { if($n 1) return 1; else return fibonacci($n - 1) + fibonacci($n - 2); } for($i = 0; $i < 15; $i++) { echo fibonacci($i) . "<br />"; } ?>


Write a program to convert a 2 digit BCD number into hexadecimal number?

Write a program to convert a 2-digit BCD number into hexadecimal


1.Write a c program for Fibonacci series?

/*program to calculate factorial of a number*/ #include<stdio.h> #include<conio.h> void main() { long int n; int a=1; clrscr(); printf("enter the number="); scanf("%ld",&n); while(n>0) { a*=n; n--; } printf("the factorial is %ld",a); getch(); }


Write a Fibonacci function then takes an input from the user in main program and pass to function which prints Fibonacci series up to this number in c language by using while statement?

#include#includevoid fibonacci(int x){int f=0,m=-1,n=1,i=0;while(i


2 Write a program to convert a 2-digit BCD number into hexadecimal?

WRITE A PROGRAM TO CONVERT A 2-DIGIT bcd NUMBER INTO HEXADECIMAL


Write a Fibonacci function then takes an input from the user in main program and pass to function which prints Fibonacci series up to this number in c language by using for statement?

#include<stdio.h> #include<conio.h> void fibonacci(int x) { int f=0,m=-1,n=1,i; for(i=0;i<x;i++) { f=m+n; printf("%d\n",f); m=n; n=f; } } void main() { int n; clrscr(); printf("\nEnter the limit:"); scanf("%d",&n); fibonacci(n); getch(); }


How do you write prime number program in C language?

[ Fibonacci series___: ] #include<stdio.h> int main(void) { int n,i,c,a=0,b=1; printf("Enter Fibonacci series of nth term : "); scanf("%d",&n); printf("%d %d ",a,b); for(i=0;i<=(n-3);i++) { c=a+b; a=b; b=c; printf("%d ",c); } }


Write a c program to generate Fibonacci series using copy constructor?

#include #include void main(void) { int i,j,k,n; clrscr(); i=0; j=1; printf("%d %d ",i,j); for(n=0;n<=5;n++) { k=i+j; i=j; j=k; printf("%d ",k); } getch(); }


Write a program which takes any number of days from the user the program should display the number of years number of months formed by these days as well as the remaining days?

Write a program which takes any number of days from the user. the program should display the number of years, number of months formed by these days as well as the remaining days.


How do you write a c program to convert binary to decimal by using while statement?

write a c++ program to convert binary number to decimal number by using while statement