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
How will you find a duplicate number in a array without negating the nos ?
What is hashing in c?
How do you list files in a directory?
HOW TO SOLVE A NUMERICAL OF LRU IN OS ??????
Write a function stroverlap that takes (at least) two strings, and concatenates them, but does not duplicate any overlap. You only need to worry about overlaps between the end of the first string and the beginning of the second string. Examples: batman, manonthemoon = batmanonthemoon batmmamaman, mamamanonthemoon = batmmamamanonthemoon bat, man = batman batman, batman = batman batman, menonthemoon = batmanmenonthemoon
Explain how can you restore a redirected standard stream?
What are the advantages and disadvantages of pointers?
Do character constants represent numerical values?
the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b
What standard functions are available to manipulate strings?
write a c program for swapping two strings using pointer
Explain the difference between call by value and call by reference in c language?
.find the output of the following program? char*myfunc(char*ptr) { ptr +=3; return (ptr); } int main() { char*x,*y; x="HELLO"; y=myfunc(x); printf("y = %s ",y); return 0; }
How can I recover the file name given an open stream?
Can two or more operators such as and be combined in a single line of program code?