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


Please Help Members By Posting Answers For Below Questions

What is huge pointer in c?

586


Is there sort function in c?

579


What’s a signal? Explain what do I use signals for?

611


An organised method of depicting the use of an area of computer memory used to signify the uses for different parts of the memory a) swap b) extended memory c) memory map d) all of the above

708


What is a class c rental property?

618






Can you please explain the difference between exit() and _exit() function?

595


How to throw some light on the b tree?

606


how to build a exercise findig min number of e heap with list imlemented?

1613


What is the description for syntax errors?

616


Explain how do you sort filenames in a directory?

609


Write a C++ program to generate 10 integer numbers between - 1000 and 1000, then store the summation of the odd positive numbers in variable call it sum_pos, then find the maximum digit in this variable regardless of its digits length.

1571


What is struct node in c?

623


What is static memory allocation? Explain

633


What is a good data structure to use for storing lines of text?

600


hi to every one .. how to view table pool after creating the pooled table? plz help me.. if any knows abt this ..

1468