write a program to generate 1st n fibonacci prime number
Answer Posted / swapna
#include <stdio.h>
#include <conio.h>
void main ( )
{
long a,b,c,i,n,j;
clrscr( );
printf ("\n Enter the number to print fibnocci
prime number\t");
scanf ("%ld",&n);
a=0;
b=1;
for (i=1; i<n; i++)
{
c=a+b;
a=b;
b=c;
printf ("\n fibnoci series is %ld\t",c);
for(j=2;j<c;j++)
{
if(c%j==0)
break;
}
if(c==j)
printf(" prime number is %ld\t",c);
}
getch();
}
| Is This Answer Correct ? | 89 Yes | 39 No |
Post New Answer View All Answers
What is I ++ in c programming?
a) Identify the following declarations. Ex. int i (integer variable) float a[l0](array of 10 real nos) int (*f())() void *f int (*f()) [] void *f int f[] [] [] char *(*f) () int (*f[]) [] float(*f) [] [] float **f int ******f
What is the argument of a function in c?
Why pointers are used in c?
Write an algorithm for implementing insertion and deletion operations in a singly linked list using arrays ?
Can a variable be both const and volatile?
What is "Duff's Device"?
What do you mean by command line argument?
What are the usage of pointer in c?
There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?
Explain bitwise shift operators?
What is the use of extern in c?
how to write optimum code to divide a 50 digit number with a 25 digit number??
What is a void pointer? When is a void pointer used?
Are comments included during the compilation stage and placed in the EXE file as well?