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


Please Help Members By Posting Answers For Below Questions

What are virtual functions in c++?

891


Can c++ do everything c can?

803


What are keywords in c++?

830


What do you mean by static variables?

835


How to defines the function in c++?

823


Which format specifier is used for printing a pointer value?

774


How long will it take to learn programming?

789


What is stoi in c++?

912


Can we declare a base-class destructor as virtual?

755


How important is c++?

710


What language does google use?

839


What is a block in c++?

781


What is implicit conversion/coercion in c++?

965


Write syntax to define friend functions in C++.

810


Define the operators that can be used with a pointer.

785