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
Describe the process of creation and destruction of a derived class object?
When should we use container classes instead of arrays?
What are the 4 types of library?
Explain selection sorting?
What is the use of :: operator in c++?
What is the use of pointer in c++ with example?
A prime number is a number which is divisible only by itself and 1. Examples of the first few primes are 2, 3, 5, 7, 11. Consider writing a program which can generate prime numbers for you. Your program should read in and set a maximum prime to generate and a minimum number to start with when looking for primes. This program should be able to perform the following tasks: 1. Read the maximum number from user (keyboard input) to look for primes. The program should not return any primes greater than this number. 2. Read the minimum number from user (keyboard input) to look for primes. The program should not return any primes less than this number. 3. Generate and print out every prime number between the maximum prime and minimum number specified by the user.
what you know about c++?
Is c++ a high level language?
Explain what are mutator methods in c++?
What does the linker do?
Does c++ support exception handling?
What is name hiding in c++?
Why is c++ awesome?
What information can an exception contain?