write a program to generate 1st n fibonacci prime number
Answer Posted / ruchi
#include<stdio.h>
#include<conio.h>
int main()
{
int n,a=1,b,c=0,d=0,i,j;
printf("\nenter the number ");
scanf("%d",&n);
printf("\nThe fibbonacci prime numbers are ");
for(i=0;i<=n-1;i++)
{
b=c+a;
a=c;
c=b;
j=2;
while(j<=b-1)
{
if(b%j==0)
{
break;
}
j++;
}
if(j==b)
{
printf("\n%d",b);
}
}
getch();
}
| Is This Answer Correct ? | 16 Yes | 6 No |
Post New Answer View All Answers
Why is a semicolon (;) put at the end of every program statement?
What is difference between structure and union with example?
Explain what is gets() function?
typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?
Do pointers store the address of value or the actual value of a variable?
What is c method?
How many levels of pointers have?
Compare array data type to pointer data type
Explain #pragma statements.
What is chain pointer in c?
A character flag or control mechanism that delineates one data item from another a) variable b) constant c) delimiter d) call by reference
Can a file other than a .h file be included with #include?
The performance of an operation in several steps with each step using the output of the preceding step a) recursion b) search c) call by value d) call by reference
any limit on the number of functions that might be present in a C program a) max 35 functions b) max 50 functions c) no limit d) none of the above
Simplify the program segment if X = B then C ← true else C ← false