Write the program for fibonacci in c++?
Answer Posted / abhilash
int main()
{
unsigned int i=0,j=0,sum=1,num;
printf("nEnter the limit for the series ");
scanf("%d",&num);
while(sum<num)
{
printf("%d ",sum);
i=j;
j=sum;
sum=i+j;
}
getch();
}
Is This Answer Correct ? | 14 Yes | 27 No |
Post New Answer View All Answers
What is a constant? Explain with an example.
What is the fastest c++ compiler?
What do you mean by overhead in c++?
State the difference between pre and post increment/decrement operations.
Is c++ the hardest language?
What return value must conversion operators have in their declaration?
I want to write a C++ language program that: 1. Reads in the size of a square from the screen; 2. Prints a hollow square of that size out of “-“, “|” and blanks on screen; 3. Prints the same hollow square onto a text file. The program should work for squares of all side sizes between 1 and 20.
What is constructor and destructor in c++?
If dog is a friend of boy, and terrier derives from dog, is terrier a friend of boy?
What is a class template?
What is the difference between equal to (==) and assignment operator (=)?
When must you use a pointer rather than a reference?
What is the use of setprecision in c++?
What is abstraction c++?
How do you master coding?