write a program to generate 1st n fibonacci prime number
Answer Posted / jagannath
#include<stdio.h>
#include<conio.h>
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 ? | 4 Yes | 6 No |
Post New Answer View All Answers
What does it mean when the linker says that _end is undefined?
What is main () in c?
What is console in c language?
What is structure pointer in c?
What is double pointer in c?
Is javascript based on c?
Is boolean a datatype in c?
How old is c programming language?
Why does notstrcat(string, "!");Work?
Explain what is a 'locale'?
console I/O functions means a) the I/O operations done on disk b) the I/O operations done in all parts c) the input given through keyboard is displayed VDU screen d) none of the above
what is recursion in C
to print the salary of an employee according to follwing calculation: Allowances:HRA-20% of BASIC,DA-45% of BASIC,TA-10%. Deductions:EPF-8% of BASIC,LIC-Rs.200/-Prof.Tax:Rs.200/- create c language program?
Explain how can you check to see whether a symbol is defined?
How are 16- and 32-bit numbers stored?