write a program to generate 1st n fibonacci prime number

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Here is a neat trick for checking whether two strings are equal

558


Write a program to swap two numbers without using third variable in c?

607


a construct the"else" part of "if" statement contains anoth "if else" statement is called a) if-else b) else-if-else c) if-else-if-else d) chain if/if-else-if

695


This is a variation of the call_me function in the previous question:call_me (myvar)int *myvar;{ *myvar += 5; }The correct way to call this function from main() will be a) call_me(myvar) b) call_me(*myvar) c) call_me(&myvar) d) expanded memory

719


Write a c program to build a heap method using Pointer to function and pointer to structure ?

4167






How to write a multi-statement macro?

616


What do you mean by scope of a variable in c?

536


What is enumerated data type in c?

615


When do you not use the keyword 'return' when defining a function a) Always b) Never c) When the function returns void d) dfd

635


Where static variables are stored in c?

581


where are auto variables stored? What are the characteristics of an auto variable?

582


What are pointers in C? Give an example where to illustrate their significance.

737


Is c high or low level?

571


What is the best way to comment out a section of code that contains comments?

772


What is void pointers in c?

578