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
What is a catch statement?
Mention the ways in which parameterized can be invoked. Give an example of each.
What are the two types of comments, and how do they differ?
What are the differences between the function prototype and the function defi-nition?
Can we inherit constructor in c++?
What is the benefit of encapsulation?
Can union be self referenced?
What is constructor in C++?
Specify some guidelines that should be followed while overloading operators?
What is meant by iomanip in c++?
What are static member functions?
Can comments be nested?
What is new in c++?
How are pointers type-cast?
What is a unnitialised pointer?