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 / amit thakur

void main()
{
int x=1,i=0,n;
printf("Enter the value for n ");
scanf("%d",&n);
printf("\n%d ,",i);
for(;n>=1;--n)
{
x=x+i;
i=x-i;
printf("%d ,",x);
}
getch();
}

Is This Answer Correct ?    6 Yes 4 No

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

Answer / namrata

void main()
{
int x=1,i=0,n;
printf("Enter the value for n ");
scanf("%d",&n);
printf("\n%d ,",i);
for(;n>=1;--n)
{
x=x+i;
i=x-i;
printf("%d ,",x);
}
getch();
}

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More C Interview Questions

consider the following program sigment int n,sum=1; switch(n) { case 2:sum=sum+2; case 3:sum*=2; break; default:sum=0;} if n=2, what is the value of sum a.0 b.6 c.3 d.none

7 Answers   TCS,


What is scope rule in c?

0 Answers  


what does ‘#include’ mean?

1 Answers   TCS,


What is the difference between array and structure in c?

0 Answers  


What are header files and what are its uses in C programming?

0 Answers  






If null and 0 are equivalent as null pointer constants, which should I use?

0 Answers  


main() { int a=0; if(a=0) printf("Ramco Systems\n"); printf("India\n"); } output?

7 Answers   Ramco,


Explain output of printf("Hello World"-'A'+'B'); ?

0 Answers  


int a=0,b=2; if (a=0) b=0; else b=*10; What is the value of b ?

6 Answers   TCS,


Differentiate between the = symbol and == symbol?

0 Answers  


How do you print an address?

0 Answers   TCS,


How can I manipulate individual bits?

0 Answers  


Categories