answersLogoWhite

0

C program for Fibonacci

User Avatar

Anonymous

14y ago
Updated: 8/17/2019

#include<conio.h>

#include<stdio.h>

main ()

{

int f1=0,f2=1,f3=1,i,j,n;

clrscr();

printf("enter n value"):

scanf("%d",&n);

if(n<=3)

{

for(i=0;i<=n;i++)

{

f1=f2;

f2=f3;

printf("%dfibonic value is\n",f3);

f3=f1+f2;

}

else

{

printf("re ente n value");

}

getch();

}

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

Write a c program Fibonacci series using for loop in java?

Exactly what do you mean by 'C program in Java'


Can you explain the program of Fibonacci series in c?

You mean you have written a program, but you don't understand it? Well, how could I explain it without seeing it?


What is the code of a c program that will read in a positive integer value and determine If the integer is a prime number and If the integer is a Fibonacci number?

see the program


Program to generate Fibonacci series using storage class in c plus plus?

i dn't know. haha


Program that generates and displays the Fibonacci?

/*WAP to display Fibonacci series*/ #include&lt;stdio.h&gt; #include&lt;conio.h&gt; void main() { int i,a=0,b=1,c; scanf("%d",&amp;n); printf("%d\n%d",a,b); for(i=0;i&lt;n;i++) { c=a+b; a=b; b=c; printf("\n%d",c); } getch(); }


Create a c plus plus program to generate Fibonacci series?

#include #include void main() { clrscr() int a=0,b=1,c,i,n; coutn cout


How do you write prime number program in C language?

[ Fibonacci series___: ] #include&lt;stdio.h&gt; int main(void) { int n,i,c,a=0,b=1; printf("Enter Fibonacci series of nth term : "); scanf("%d",&amp;n); printf("%d %d ",a,b); for(i=0;i&lt;=(n-3);i++) { c=a+b; a=b; b=c; printf("%d ",c); } }


Write a C program Fibonacci using normal loops and conditional statements?

to print the Fibonacci series until 100 you can take the input in d to make it run for whatever value you want void main(){ int a,b,c,d; a=0; b=1; c=1; d=100; while(c&lt;d) { printf("%d\n",c); c=a+b; a=b; b=c; } }


Write a program using while loop that generates Fabonaci series up to 200?

//to generate Fibonacci series upto a range of 200....(in C).... #include&lt;stdio.h&gt; main() { int a,b,c,i; a=0; b=1; printf("\n FIBONACCI SERIES .....\t"); i=1; while(i&lt;=(200-2)) { c=a+b; printf("\t%d",c); a=b; b=c; i++; } }


Program to perform Fibonacci search in c language?

#include&lt;stdio.h&gt; int main(){ int a[10],i,n,m,c=0; printf("Enter the size of an array: "); scanf("%d",&amp;n); printf("Enter the elements of the array: "); for(i=0;i&lt;=n-1;i++){ scanf("%d",&amp;a[i]); } printf("Enter the number to be search: "); scanf("%d",&amp;m); for(i=0;i&lt;=n-1;i++){ if(a[i]==m){ c=1; break; } } if(c==0) printf("The number is not in the list"); else printf("The number is found"); return 0; }


How do you write a c program to calculate the Fibonacci series of a given number?

To write a C program that calculates the Fibonacci series up to a given number, you can use a loop to generate the series. Start by initializing the first two Fibonacci numbers (0 and 1) and then repeatedly compute the next number by adding the two preceding numbers until you reach or exceed the specified limit. Here’s a simple example: #include &lt;stdio.h&gt; int main() { int n, t1 = 0, t2 = 1, nextTerm; printf(&quot;Enter a positive integer: &quot;); scanf(&quot;%d&quot;, &amp;n); printf(&quot;Fibonacci Series: %d, %d&quot;, t1, t2); for (int i = 3; i &lt;= n; ++i) { nextTerm = t1 + t2; printf(&quot;, %d&quot;, nextTerm); t1 = t2; t2 = nextTerm; } return 0; } This program prompts the user for a number and prints the Fibonacci series up to that number.


What were Fibonacci's surnames?

The renowned Middle Ages mathematician's REAL NAME was Leonardo Pisano Bigollo (c. 1170 - c. 1250), but he was known by many names, such as Leonardo of Pisa, Leonardo Pisano, Leonardo Bonacci, Leonardo Fibonacci, and just plain Fibonacci.