ProAnswers.org

how we run the loop in the array

#include

int main() 

{

int i, a[25];

 a[0] = 0;

 a[1] = 1;

 ///////// useing of loop in an array

 for (i = 2; i < 10; i++) 

 {

  a[i] = a[i - 1] + a[i - 2];

 }

 printf("The fibonacci series is as follows 

");

 for (i = 0; i < 10; i++) {

  printf("%d 

", a[i]);

 }

}