write a program to generate 1st n fibonacci prime number
Answer Posted / swapna
#include <stdio.h>
#include <conio.h>
void main ( )
{
long a,b,c,i,n,j;
clrscr( );
printf ("\n Enter the number to print fibnocci
prime number\t");
scanf ("%ld",&n);
a=0;
b=1;
for (i=1; i<n; i++)
{
c=a+b;
a=b;
b=c;
printf ("\n fibnoci series is %ld\t",c);
for(j=2;j<c;j++)
{
if(c%j==0)
break;
}
if(c==j)
printf(" prime number is %ld\t",c);
}
getch();
}
Is This Answer Correct ? | 89 Yes | 39 No |
Post New Answer View All Answers
What is sizeof return in c?
What is the difference between exit() and _exit() function in c?
How do you redirect a standard stream?
What is the advantage of an array over individual variables?
What is bubble sort technique in c?
How macro execution is faster than function ?
What are the advantages of using new operator as compared to the function malloc ()?
Why do we use static in c?
What is dynamic dispatch in c++?
What is difference between structure and union in c programming?
What is boolean in c?
What are the advantages of c preprocessor?
Can you subtract pointers from each other? Why would you?
How can I write data files which can be read on other machines with different word size, byte order, or floating point formats?
Is linux written in c?