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
Who is the main contributor in designing the c language after dennis ritchie?
What are different types of operators?
What are header files and explain what are its uses in c programming?
Synonymous with pointer array a) character array b) ragged array c) multiple array d) none
Explain modulus operator.
What is spark map function?
What are the advantages of using linked list for tree construction?
Write the test cases for checking a variable having value in range -10.0 to +10.0?
How does struct work in c?
What is calloc()?
can we change the default calling convention in c if yes than how.........?
How can I read in an object file and jump to locations in it?
The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration
What are qualifiers in c?
Explain what is gets() function?