write a program to generate 1st n fibonacci prime number
Answer Posted / rose
void main()
{
int x1,x2,x3,i,n;
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 ? | 6 Yes | 12 No |
Post New Answer View All Answers
What does %2f mean in c?
What are qualifiers and modifiers c?
Can you assign a different address to an array tag?
Why is c fast?
Do you know the difference between exit() and _exit() function in c?
Where can I get an ansi-compatible lint?
Explain how do you list files in a directory?
Which is better oop or procedural?
How can I get the current date or time of day in a c program?
What is wrong in this statement?
What is #line in c?
If a five digit number is input through the keyboard, write a program to print a new number by adding one to each of its digits.For example if the number that is input is 12391 then the output should be displayed as 23402
Difference between constant pointer and pointer to a constant.
Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.
How is a null pointer different from a dangling pointer?