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

What is ## preprocessor operator in c?

0 Answers  


What is meant by high-order and low-order bytes?

0 Answers  


Given an array of characters which form a sentence of words, give an efficient algorithm to reverse the order of the words (not characters) in it?

3 Answers  


Calculate 1*2*3*____*n using recursive function??

0 Answers  


what is the output of the following program? #include<stdio.h> void main() { float x=1.1; while(x==1.1) { printf("\n%f",x); x=x-0.1; } }

6 Answers  






write a c program to find the roots of a quadratic equation ax2 + bx + c = 0

11 Answers   CSC, St Marys, TATA,


what do u mean by Direct access files? then can u explain about Direct Access Files?

0 Answers   LG Soft,


Hi Every one......... Please Any body give me the answer for my question. Is it possible to print the word "PRINT F", without using printf() statement in C-Language.

4 Answers  


What is identifier in c?

0 Answers  


a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list

0 Answers  


Can we compile a program without main() function?

0 Answers  


Why is %d used in c?

0 Answers  


Categories