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 are virtual functions in c++?
Can c++ do everything c can?
What are keywords in c++?
What do you mean by static variables?
How to defines the function in c++?
Which format specifier is used for printing a pointer value?
How long will it take to learn programming?
What is stoi in c++?
Can we declare a base-class destructor as virtual?
How important is c++?
What language does google use?
What is a block in c++?
What is implicit conversion/coercion in c++?
Write syntax to define friend functions in C++.
Define the operators that can be used with a pointer.