Write the program for fibonacci in c++?
Answer Posted / jitendra goyal
#include<stdio.h>
#include<conio.h>
main()
{
int a=0,b=1,n,c;
printf("how many element you want in series");
scanf("%d",&n);
printf("%d%d",a,b);
for(i=0;i<=n-2;i++)
{
c=a+b;
print("%d",c);
a=b;
b=c;
}
getch();
}
| Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
Explain abstraction.
Describe new operator?
What is using namespace std in c++?
total amount of milk produced each morning and then calculates and outputs the number of cartons needed for this milk , the cost of producing the milk and the profit from producing this milk.
Which is better c++ or java?
What does 7/9*9 equal ? a) 1 b) 0.08642 c) 0
What is a lambda function c++?
What is c++ hiding?
What is #include cmath?
int age=35; if(age>80) {Console.WriteLine("Boy you are old");} else {Console.WrieLine("That is a good age");}
How can we access protected and private members of a class?
What is a pdb file?
Is c++ the most powerful language?
What are the benefits of pointers?
What are c++ data types?