Commit 556926c0 by chazog

fibonacci sequence

parent f99380b5
Showing with 20 additions and 0 deletions
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n1=0,n2=1,n3,i,number;
printf("Enter the number of integers:");
scanf("%d",&number);
printf("\n%d %d",n1,n2);
for(i=2;i<number;++i)
{
n3=n1+n2;
printf(" %d",n3);
n1=n2;
n2=n3;
}
getch();
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment