Month: December 2023

Write a program to calculate a fibonacci series in c

#include<stdio.h>     main()     {      int n1=0,n2=1,n3,i,n;      printf(“Enter the number of elements:”);      scanf(“%d”,&n);      printf(“\n%d %d”,n1,n2);      for(i=2;i<n;++i)      {       n3=n1+n2;       printf(” %d”,n3);       n1=n2;       n2=n3;      }     return 0;    }     output : Enter the number of elements:15 0 1 1 2 3 5 8…