answersLogoWhite

0

C program for tribonacci series

Updated: 8/10/2023
User Avatar

Wiki User

14y ago

Best Answer

#include<iostream>

int main()

{

int x=0, y=1;

std::cout<<x<<" ";

std::cout<<y<<" ";

while( y<1000000 )

{

std::cout<<(y+=x)<<" ";

x=y-x;

}

std::cout<<std::endl;

return(0);

}

User Avatar

Wiki User

10y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

11y ago

#include

#include

main()

{

int n,i,c,a=0,b=1;

printf("Enter Fibonacci series of nth term : ");

scanf("%d",&n);

printf("%d %d ",a,b);

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

{

c=a+b;

a=b;

b=c;

printf("%d ",c);

}

getch();

}

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

#include<stdio.h>

#include<conio.h>

void main ()

{

int x,y,z,i;

clrscr();

printf("Enter 1st Term: ");

scanf("%d",&x);

printf("Enter 2nd Term: ");

scanf("%d",&y);

printf("Series is: \n");

printf("%d ",x);

printf("%d ",y);

for(i=1;i<=23;i++)

{

z=x+y;

printf("%d ",z);

x=y;

y=z;

}

getch();

}

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

#include<stdio.h>

#include<conio.h>

void main()

{

int a =1,b=0,c=0;

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

{

printf("%d",c);

c=a+b;

a=b;

b=c;

getch();

}

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

I'm nearly 100% sure I'm doing your homework for you. If I am, then I really am disappointed. First of all, the name is "Fibonacci" and is detailed on wikipedia.

I'll just type it here and if it compiles, great, if not... I'm not going to do the whole assignment for you.

#include <stdio.h>

int main(int argc, char **argv)

{

int previousValueA = 0;

int previousValueB = 1;

int steps = 100;

int i;

int current;

printf("%d\n", previousValueA);

printf("%d\n", previousValueB);

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

{

current = previousValueA + previousValueB;

previousValueA = previousValueB;

previousValueB = current;

printf("%d\n", current);

}

return 0;

}

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

#include void tribon(int n) { int a,b,c,d,i; b=1; c=0; d=0; i=1; while(i

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

#include <stdio.h>

unsigned long fib (unsigned long n) {

if (n 95, for 64 bit unsigned longs, due to integer overflow.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: C program for tribonacci series
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Program for sin series in c language?

find the program in c-pgms.blogspot.com


What is meant by tribonacci series?

That would be the "fibonacci" series. It is the series of numbers:1 1 2 3 5 8 13 21...Where each number is the sum of the previous two.


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

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


Write a c program to solve cos series?

Please do.


Write a C program to print the following series 112 122 . 1n2?

write a program to print the series 1/12+1/22+.........+1/n2 ?


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 c program to find fibnocci series?

#include&lt;stdio.h&gt; #include&lt;conio.h&gt; void main() { }


How do you write a C program to Calculate the Series. The Value of x and n must take from input terminal.?

Reference:cprogramming-bd.com/c_page2.aspx# sum the series


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

i dn't know. haha


Can you have the program in C plus plus for recursive function generating a series of terms?

Yes, this can be done. For example for Fibonacci series. You will find plenty of examples if you google for the types of series you need to be generated.


Features of c program?

the features of a C program


C program was introduced in the year?

c program was introduced in the year 1972 by Dennis RitchieNo, it was the C language, not the C program.