Computer Science, asked by patelsaurin2461, 10 months ago

C program to generate Fibonacci series using function of type without argument without return value

Answers

Answered by Rahul9048
7

Answer:

#include <stdio.h>

int main()

{ int t1 = 0, t2 = 1, nextTerm = 0, n;

printf("Enter a positive number: ");

scanf("%d", &n);

// displays the first two terms which is always 0 and 1

printf("Fibonacci Series: %d, %d, ", t1, t2);

nextTerm = t1 + t2; while (nextTerm <= n)

{ printf("%d, ", nextTerm); t1 = t2; t2 = nextTerm;

nextTerm = t1 + t2; }

return 0; }

Explanation:

hope u like this

mark me as brainlieast

Answered by yogeshjindam2002
0

i am beginners sorry i dont know

Similar questions