Computer Science, asked by tanishdesai786, 6 months ago

Write a Program to Print Fibbonaci Series using function​

Answers

Answered by shashwat05
0

Answer:

ibonacci series program in C

int main() { int n, first = 0, second = 1, next, c;

printf("Enter the number of terms\n"); scanf("%d", &n);

printf("First %d terms of Fibonacci series are:\n", n);

for (c = 0; c < n; c++) { if (c <= 1) next = c; else. { next = first + second; first = second; second = next; } ...

return 0; }

Answered by lobhasimali09
0

Answer:

program is in python

Explanation:

x=int(input("Enter a number of elements in Fibonacci Series"))

def fib1():

f1=0

f2=1

print("The Fibonacci Series :")

print(f1,end=" ")

print(f2,end=" ")

for i in range (x-2) :

f3=f1+f2

f1=f2

f2=f3

print(f3, end=" ")

fib1()

note: be careful with the indentation

Hope this helps

Similar questions