In this problem, we will explain the fibonacci series, coded with arrays taking the user input.
#include<stdio.h>
int main()
{
int n, i, num[30];
printf("How many fibonacci numbers: ");
scanf("%d",&n);
num[0] = 0;
num[1] = 1;
for(i=2; i<n; i++)
{
num[i] = num[i-1] + num[i-2];
}
printf("\n");
for(i=0; i<n; i++)
{
printf("%d ",num[i]);
}
return 0;
}
Hi, this is a comment.
To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.
Commenter avatars come from Gravatar.