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 will happen if a pointer is deleted twice?
Show the declaration for a static member variable.
Write a program which uses functions like strcmp(), strcpy()? etc
Why c++ is called oop?
Tell me can a pure virtual function have an implementation?
What is the use of ::(scope resolution operator)?
Should I learn c or c++ or c#?
What is implicit conversion/coercion in c++?
What is a lambda function c++?
Explain function overloading
When you overload member functions, in what ways must they differ?
What are the various operations performed on stack?
What is the use of string in c++?
What are guid? Why does com need guids?
Write about the various sections of the executable image?