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

please give me some tips for the selection in TCS.

3 Answers   TCS,


Explain how do you determine whether to use a stream function or a low-level function?

0 Answers  


What is the use of header?

0 Answers  


void main() { char far *farther,*farthest; printf("%d..%d",sizeof(farther),sizeof(farthest)); }

3 Answers   ME, pspl,


Tell me what are bitwise shift operators?

0 Answers  


How to establish connection with oracle database software from c language?

0 Answers  


program to convert a integer to string in c language'

0 Answers  


What is c basic?

0 Answers  


How to compare array with pointer in c?

0 Answers  


Why is python slower than c?

0 Answers  


What is %lu in c?

0 Answers  


What is the difference between constant pointer and pointer to a constant. Give examples.

4 Answers   TCS,


Categories