write a program to generate 1st n fibonacci prime number
Answer Posted / swapna
#include <stdio.h>
#include <conio.h>
void main ( )
{
long a,b,c,i,n,j;
clrscr( );
printf ("\n Enter the number to print fibnocci
prime number\t");
scanf ("%ld",&n);
a=0;
b=1;
for (i=1; i<n; i++)
{
c=a+b;
a=b;
b=c;
printf ("\n fibnoci series is %ld\t",c);
for(j=2;j<c;j++)
{
if(c%j==0)
break;
}
if(c==j)
printf(" prime number is %ld\t",c);
}
getch();
}
Is This Answer Correct ? | 89 Yes | 39 No |
Post New Answer View All Answers
What does 1f stand for?
What is "Hungarian Notation"?
How many keywords are there in c?
What is the difference between the expression “++a” and “a++”?
Explain with the aid of an example why arrays of structures don’t provide an efficient representation when it comes to adding and deleting records internal to the array.
Why static variable is used in c?
What is the Purpose of 'extern' keyword in a function declaration?
What is main () in c language?
What do you mean by dynamic memory allocation in c?
The number of bytes of storage occupied by short, int and long are a) 2, 2 and 4 b) 2, 4 and 4 c) 4, 4 and 4 d) none
Explain how do you print an address?
What are the basic data types associated with c?
What is the difference between far and near ?
Write a program to generate random numbers in c?
What functions are used in dynamic memory allocation in c?