write a program to generate 1st n fibonacci prime number

Answer Posted / abdifatah mohiadin adam

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 ?    9 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different types of data structures in c?

609


What is malloc return c?

601


Is c weakly typed?

580


Describe wild pointers in c?

641


What are bitwise shift operators in c programming?

649






in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above

636


Give me the code of in-order recursive and non-recursive.

887


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

2414


What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

734


Write a C program linear.c that creates a sequence of processes with a given length. By sequence it is meant that each created process has exactly one child. Let's look at some example outputs for the program. Here the entire process sequence consists of process 18181: Sara@dell:~/OSSS$ ./linear 1 Creating process sequence of length 1. 18181 begins the sequence. An example for a sequence of length three: Sara@dell:~/OSSS$ ./linear 3 Creating process sequence of length 3. 18233 begins the sequence. 18234 is child of 18233 18235 is child of 18234 ........ this is coad .... BUt i could not compleate it .....:( #include #include #include #include int main(int argc, char *argv[]) { int N; pid_t pid; int cont; if (argc != 2) { printf("Wrong number of command-line parameters!\n"); return 1; } N = atoi(argv[1]); printf("Creating process sequence of length %d.\n",N); printf("%d begins the sequence.\n",getpid()); /* What I have to do next ?????? */ }

1621


Explain how do you override a defined macro?

589


Describe the modifier in c?

604


How does #define work?

651


Why header files are used?

646


What are the loops in c?

594