write a program to generate 1st n fibonacci prime number

Answers were Sorted based on User's Feedback



write a program to generate 1st n fibonacci prime number..

Answer / arun

void main()
{
int x1,x2,x3,n,i;
x1=0;
x2=1;
printf("enter a value for n : ");
scanf("%d",&n);
printf("%d %d ",x1,x2);
for(i=3;i<=n;i++)
{
x3=x1+x2;
printf("%d ",x3);
x1=x2;
x2=x3;
}
}

Is This Answer Correct ?    4 Yes 10 No

write a program to generate 1st n fibonacci prime number..

Answer / gayathri

void main()
{
int x1,x2,x3,i;
x1=-1;
x2=1;
printf("enter the value for n :");
scanf("%d",&n);
print
for(i=0;i<n;i++)
{
x3=x1+x2;

if((x3 mod 2)!=0)
{
printf("%d ",x3)
}
x1=x2;
x2=x3;
}

}

Is This Answer Correct ?    7 Yes 15 No

Post New Answer

More C Interview Questions

How can we allocate array or structure bigger than 64kb?

2 Answers   CSC,


Explain the difference between call by value and call by reference in c language?

0 Answers  


Is both getch() and getchar() functions are similar? if it is similar means why these two functions are used for same usage? if it is not similar means what is the difference?

1 Answers   Infosys,


what is data structure

5 Answers   Maveric, TCS,


What is #define?

0 Answers  


Explain what are compound statements?

0 Answers  


write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?

0 Answers   Wipro,


What is pre-emptive data structure and explain it with example?

0 Answers  


How do you convert a decimal number to its hexa-decimal equivalent.Give a C code to do the same

0 Answers   Amazon,


Explain command-line arguments in C.

1 Answers  


write a program to print %d ?

12 Answers  


Is javascript based on c?

0 Answers  


Categories