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 / ruchi

#include<stdio.h>
#include<conio.h>
int main()
{
int n,a=1,b,c=0,d=0,i,j;
printf("\nenter the number ");
scanf("%d",&n);
printf("\nThe fibbonacci prime numbers are ");
for(i=0;i<=n-1;i++)
{
b=c+a;
a=c;
c=b;
j=2;
while(j<=b-1)
{

if(b%j==0)
{

break;
}
j++;
}
if(j==b)
{
printf("\n%d",b);
}

}
getch();
}

Is This Answer Correct ?    16 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Who is the main contributor in designing the c language after dennis ritchie?

1012


What are different types of operators?

1047


What are header files and explain what are its uses in c programming?

1135


Synonymous with pointer array a) character array b) ragged array c) multiple array d) none

1079


Explain modulus operator.

1065


What is spark map function?

1146


What are the advantages of using linked list for tree construction?

1104


Write the test cases for checking a variable having value in range -10.0 to +10.0?

2325


How does struct work in c?

1097


What is calloc()?

1082


can we change the default calling convention in c if yes than how.........?

2542


How can I read in an object file and jump to locations in it?

1035


The process of repeatedly running a set of computer instructions until some condition is specifed a) condition b) sequential condition c) global d) iteration

1110


What are qualifiers in c?

1042


Explain what is gets() function?

1085