Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Can the sizeof operator be used to tell the size of an array passed to a function?

1076


What language is windows 1.0 written?

1006


about c language

1978


write a progrmm in c language take user interface generate table using for loop?

2012


Devise a program that inputs a 3 digit number n and finds out whether the number is prime or not. Find out its factors.

1093


How do you generate random numbers in C?

1164


What is atoi and atof in c?

1050


What is the meaning of 2d in c?

1079


What is the advantage of a random access file?

1156


A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM

2099


What is c language used for?

947


Which is the memory area not included in C program? give the reason

1912


What are formal parameters?

1081


What is indirection?

1050


How can you increase the size of a dynamically allocated array?

1155