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
Why is c platform dependent?
What is array in c with example?
What are the 5 organizational structures?
What is pointer & why it is used?
Differentiate between new and malloc(), delete and free() ?
What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.
What is self-referential structure in c programming?
What is the use of pragma in embedded c?
write a program to rearrange the array such way that all even elements should come first and next come odd
What is s or c?
Why is void main used?
What does 3 mean in texting?
What is the best way to store flag values in a program?
How do you write a program which produces its own source code as output?
What is the difference between far and near in c?