write a program to generate 1st n fibonacci prime number
Answer Posted / rajesh kumar s
int main()
{
int f=0,s=1,t=1,n,fl;
printf("enter the limit\t:");
scanf("%d",&n);
printf("\nfirst %d prime fibonacci numbers
are\n",n);
while(n)
{
fl=0;
fl=prime(f);
if(f>1 && fl==1)
{
printf("%d\t",f);
n=n-1;
}
s=t;
t=f;
f=s+t;
}
}
int prime(int x)
{
int i,f=0;
for(i=2;i<=x/2;i++)
{
if(x%i==0)
{
f=1;
break;
}
}
if(f==0)
{
return 1;
}
else
return 0;
}
| Is This Answer Correct ? | 26 Yes | 14 No |
Post New Answer View All Answers
Can the sizeof operator be used to tell the size of an array passed to a function?
What language is windows 1.0 written?
about c language
write a progrmm in c language take user interface generate table using for loop?
Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.
How do you generate random numbers in C?
What is atoi and atof in c?
What is the meaning of 2d in c?
What is the advantage of a random access file?
A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM
What is c language used for?
Which is the memory area not included in C program? give the reason
What are formal parameters?
What is indirection?
How can you increase the size of a dynamically allocated array?