Write the program for fibonacci in c++?
Answer Posted / n.muthukumar
#include
int main()
{
unsigned int i=0,j=0,sum=1,num;
printf("nEnter the limit for the series ");
scanf("%d",&num);
printf("%d",i);
while(sum
{
printf("%d ",sum);
i=j;
j=sum;
sum=i+j;
}
getch();
}
| Is This Answer Correct ? | 12 Yes | 25 No |
Post New Answer View All Answers
What is the difference between a type-specific template friend class and a general template friend class?
What is the difference between C and CPP?
What are the uses of c++ in the real world?
If horse and bird inherit virtual public from animal, do their constructors initialize the animal constructor? If pegasus inherits from both horse and bird, how does it initialize animal’s constructor?
How to defines the function in c++?
Who calls main function?
What do you mean by friend class & friend function in c++?
What apps are written in c++?
What is c++ code?
Must accepts "Maestro Cards" Tax for bike should be less than 15 Total number of lanes is more than 10 Must provides monthly pass Write a method: boolean isGoodTollBridge(String[] cardsAccepted, String[] tollTax, boolean hasMonthlyPass, int numberOfLanes); String[] cardsAccepted A String array of names of card types accepted for payment of toll tax, it can be null if the toll does not accept any card String[] tollTax A String array of toll tax chart (say “Train : 300â€Â,â€ÂBullCart : 10â€Â) boolean hasMonthlyPass This parameter defines whether there is any monthly pass available or not int numberOfLanes This parameter defines the number of lanes for each side
Difference between Abstraction and encapsulation in C++?
What are arrays c++?
What is the main purpose of c++?
Can we inherit constructor in c++?
Where are setjmp and longjmp used in c++?