Program:- #include<stdio.h> void main() { int n,a,b=-1,c=1; printf(" Enter The Number Of Terms:"); scanf("%d",&n); printf(" The Fibonacci Series is:"); do { a=b+c; b=c; c=a; printf(" \n %d",a); n--; }while(n>0); } Output:-
No comments:
Post a Comment