write a program to display in fabonicc series:
0 1 1 2 5 8 up to nth term
Answers
Answered by
3
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
3
Answer:
View the attachment.
Just do one modification in place of n write something else and in place of while(n<=10); write variable p.
Hope you understand.
Attachments:
Similar questions