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
Why do we use return in c?
Hello. How to write a C program to check and display president party like if i type in the console "biden" and hit enter the output shoud be : "biden is democrat" and if i type "trump" and hit enter the output shoud be: "trump is republican"
Which is best book for data structures in c?
What are the uses of null pointers?
What does do in c?
How reliable are floating-point comparisons?
What are header files in c?
Why are some ANSI/ISO Standard library routines showing up as undefined, even though I've got an ANSI compiler?
"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above
What is the difference between single charater constant and string constant?
Write a program for finding factorial of a number.
What is wrong in this statement? scanf(ā%dā,whatnumber);
Explain two-dimensional array.
What is the most efficient way to count the number of bits which are set in an integer?
What is a global variable in c?