C++ PROGRAM FOR FIBONACCI SERIES USING STDIO.H


#include<conio.h>
#include<stdio.h>

int main(){
int f=0,s=1,nn,n,i;
printf("Enter Number: ");
scanf("%d",&nn);
for(i=0;i<nn;i++){
if(nn<=1) n=i;
else{n=f+s; f=s; s=n;} 
printf("\n%d",n);}
getch();
}

Output:

Comments