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 .obj file in c?
Who developed c language and when?
What are the basic data types associated with c?
Explain indirection?
Did c have any year 2000 problems?
What is c mainly used for?
How can I open a file so that other programs can update it at the same time?
Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix
a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list
What is difference between constant pointer and constant variable?
What is variable and explain rules to declare variable in c?
What is the difference between far and near in c?
What are qualifiers in c?
Explain the ternary tree?
What does sizeof function do?