write a program to generate 1st n fibonacci prime number
Answer Posted / ruchi
#include<stdio.h>
#include<conio.h>
int main()
{
int n,a=1,b,c=0,d=0,i,j;
printf("\nenter the number ");
scanf("%d",&n);
printf("\nThe fibbonacci prime numbers are ");
for(i=0;i<=n-1;i++)
{
b=c+a;
a=c;
c=b;
j=2;
while(j<=b-1)
{
if(b%j==0)
{
break;
}
j++;
}
if(j==b)
{
printf("\n%d",b);
}
}
getch();
}
Is This Answer Correct ? | 16 Yes | 6 No |
Post New Answer View All Answers
how do you write a function that takes a variable number of arguments? What is the prototype of printf () function?
Explain what is operator promotion?
write a program to input 10 strings and compare without using strcmp() function. If the character of one string matches with the characters of another string , sort them and make it a single string ??? example:- str1="Aakash" st2="Himanshu" str="Uday" output:- Aakashimanshuday (please post the answer as quickly as possible)
What does sizeof int return?
What is the general form of a C program?
How will you write a code for accessing the length of an array without assigning it to another variable?
Explain what is gets() function?
What is #define?
Why use int main instead of void main?
Is it acceptable to declare/define a variable in a c header?
What does dm mean sexually?
Write a code on reverse string and its complexity.
What is the size of enum in bytes?
Explain what is the difference between null and nul?
void main(int n) { if(n==0) return; main(--n); printf("%d ",n); getch(); } how it work and what will be its output...............it any one know ans plz reply