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
In C language what is a 'dangling pointer'?
I need a help with a program: Write a C program that uses data input in determining the whole of points A and a whole of circles B. Find two points in A so that the line which passes through them, cut through the maximum number of circles.
Which header file is used for clrscr?
What is wrong with this initialization?
When is a null pointer used?
How can I call fortran?
Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop
What is difference between union and structure in c?
Explain what are compound statements?
any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()
How are variables declared in c?
When should the register modifier be used? Does it really help?
What are reserved words with a programming language?
Explain null pointer.
How many levels deep can include files be nested?