Write a c program to print Fibonacci upto numbers
Answers
Answered by
1
Answer:
Fibonacci Series in C without recursion
#include<stdio.h>
int main()
{
int n1=0,n2=1,n3,i,number;
printf("Enter the number of elements:");
scanf("%d",&number);
printf("\n%d %d",n1,n2);//printing 0 and 1.
for(i=2;i<number;++i)//loop starts from 2 because 0 and 1 are already printed.
Answered by
0
Answer:
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; }
Explanation:
please mark me as brainlist
Similar questions