write a program to generate 1st n fibonacci prime number
Answer Posted / nirupam mondal
#include <stdio.h>
void main ( )
{
long a,b,temp,i,n,j;
printf ("Enter the limit upto which you wantto print the fibonacci series : ");
scanf ("%ld",&n);
a=0;
b=1;
for (i=1; i<n; i++)
{
printf ("
%ld ",temp);
temp=a+b;
a=b;
b=temp;
for(j=2;j<temp;j++)
{
if(temp%j==0)
break;
}
if(temp==j)
printf(" The corresponding prime numbers of the series are : %ld ",temp);
}
}
| Is This Answer Correct ? | 0 Yes | 3 No |
Post New Answer View All Answers
What is the difference between exit() and _exit() function?
Why do we use namespace feature?
What is use of bit field?
Is javascript written in c?
What are the functions to open and close file in c language?
What is storage class?
Is swift based on c?
How can I rethow can I return a sequence of random numbers which dont repeat at all?
Explain what is meant by 'bit masking'?
Is c object oriented?
What is huge pointer in c?
where are auto variables stored? What are the characteristics of an auto variable?
Why is c platform dependent?
what is the significance of static storage class specifier?
What are the primitive data types in c?