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 does count ++ do in c++?
What are the advantages of using friend classes?
How many characters are recognized by ANSI C++?
What does n mean in c++?
What is the c++ code?
What is the precedence when there is a global variable and a local variable in the program with the same name?
Is multimap sorted c++?
List down the guideline that should be followed while using friend function.
If a header file is included twice by mistake in the program, will it give any error?
What are the differences between malloc() and calloc()?
What is auto used for in c++?
How can you tell what shell you are running on unix system?
What are c++ variables?
What are the uses of typedef in a program?
What do you understand by zombie objects in c++?