answersLogoWhite

0

1.start

2.a=0,b=1,c and counter

3.display a

4.display b

5.c=a+b

6.display c

7.a=b

8.b=c

9.check whether number is less than the last number you have

if yes than go to step 5

if no stop it

User Avatar

Wiki User

15y ago

What else can I help you with?

Continue Learning about Engineering

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 <stdio.h> int main() { int n, t1 = 0, t2 = 1, nextTerm; printf("Enter a positive integer: "); scanf("%d", &n); printf("Fibonacci Series: %d, %d", t1, t2); for (int i = 3; i <= n; ++i) { nextTerm = t1 + t2; printf(", %d", nextTerm); t1 = t2; t2 = nextTerm; } return 0; } This program prompts the user for a number and prints the Fibonacci series up to that number.


Write a flowchart of reverse the string in c?

wefwfe


Flowchart for Fibonacci series in c language?

#include<stdio.h> void printFibonacci(int); int main(){ int k,n; long int i=0,j=1,f; printf("Enter the range of the Fibonacci series: "); scanf("%d",&n); printf("Fibonacci Series: "); printf("%d %d ",0,1); printFibonacci(n); return 0; } void printFibonacci(int n){ static long int first=0,second=1,sum; if(n>0){ sum = first + second; first = second; second = sum; printf("%ld ",sum); printFibonacci(n-1); } }


Fibbomacci series using recursion shell programming?

Here is a good answer for recursion Fibonacci series. #include <stdio.h> #include <conio.h> long Fibonacci(long n); int main() { long r, n,i; printf("Enter the value of n: "); scanf("%ld",&n); for(i=0;i<=n;i++) { printf(" Fibonacci(%ld)= %ld\n", i,Fibonacci(i)); } getch(); return 0; } long Fibonacci(long n) { if(n==0 n==1) return n; else { return (Fibonacci(n-1)+Fibonacci(n-2)); } } for n=5; Output: Fibonacci(0)=0 Fibonacci(1)=1 Fibonacci(2)=1 Fibonacci(3)=2 Fibonacci(4)=3 Fibonacci(5)=5


Write a c program to generate Fibonacci series using copy constructor?

#include #include void main(void) { int i,j,k,n; clrscr(); i=0; j=1; printf("%d %d ",i,j); for(n=0;n<=5;n++) { k=i+j; i=j; j=k; printf("%d ",k); } getch(); }