write a program to generate 1st n fibonacci prime number
Answer Posted / nirupam mondal
#include <stdio.h>
void main ( )
{
long a,b,temp,i,n,j;
printf ("Enter the limit upto which you wantto print the fibonacci series : ");
scanf ("%ld",&n);
a=0;
b=1;
for (i=1; i<n; i++)
{
printf ("
%ld ",temp);
temp=a+b;
a=b;
b=temp;
for(j=2;j<temp;j++)
{
if(temp%j==0)
break;
}
if(temp==j)
printf(" The corresponding prime numbers of the series are : %ld ",temp);
}
}
| Is This Answer Correct ? | 0 Yes | 3 No |
Post New Answer View All Answers
What is the data segment that is followed by c?
What does %p mean c?
main() { struct s1 { char *str; struct s1 *ptr; }; static struct s1 arr[] = { {"Hyderabad",arr+1}, {"Bangalore",arr+2}, {"Delhi",arr} }; struct s1 *p[3]; int i; < BR> for(i=0;i<=2;i++) p[i] = arr[i].ptr; printf("%s ",(*p)->str); printf("%s ",(++*p)->str); printf("%s ",((*p)++)->str); }
largest Of three Number using without if condition?
What is hashing in c?
What is meant by realloc()?
Write a program to print ASCII code for a given digit.
How can I delete a file?
Once I have used freopen, how can I get the original stdout (or stdin) back?
What is exit() function?
What is sizeof in c?
What is context in c?
How are 16- and 32-bit numbers stored?
An expression to whose value an operater is applied a) operand b) variable c) constant d) all of the above
What are predefined functions in c?