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

how do you write a function that takes a variable number of arguments? What is the prototype of printf () function?

1500


Explain what is operator promotion?

639


write a program to input 10 strings and compare without using strcmp() function. If the character of one string matches with the characters of another string , sort them and make it a single string ??? example:- str1="Aakash" st2="Himanshu" str="Uday" output:- Aakashimanshuday (please post the answer as quickly as possible)

1629


What does sizeof int return?

596


What is the general form of a C program?

601






How will you write a code for accessing the length of an array without assigning it to another variable?

618


Explain what is gets() function?

638


What is #define?

578


Why use int main instead of void main?

601


Is it acceptable to declare/define a variable in a c header?

688


What does dm mean sexually?

817


Write a code on reverse string and its complexity.

611


What is the size of enum in bytes?

593


Explain what is the difference between null and nul?

663


void main(int n) { if(n==0) return; main(--n); printf("%d ",n); getch(); } how it work and what will be its output...............it any one know ans plz reply

2230