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


Please Help Members By Posting Answers For Below Questions

What does 1f stand for?

616


What is "Hungarian Notation"?

639


How many keywords are there in c?

595


What is the difference between the expression “++a” and “a++”?

652


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.

2658






Why static variable is used in c?

561


What is the Purpose of 'extern' keyword in a function declaration?

656


What is main () in c language?

602


What do you mean by dynamic memory allocation in c?

656


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

768


Explain how do you print an address?

661


What are the basic data types associated with c?

820


What is the difference between far and near ?

691


Write a program to generate random numbers in c?

666


What functions are used in dynamic memory allocation in c?

599