fork download
  1. #include <stdio.h>
  2. int main()
  3. {
  4. int i;
  5. double a[10];
  6.  
  7. a[0]=2;
  8. for ( i=1 ; i<10; i++)
  9. a[i] = a[i-1] /3.0+ 3;
  10. for ( i=0 ; i<10; i++)
  11. printf ("%lf ",a[i]);
  12. printf("\n");
  13.  
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0s 5508KB
stdin
Standard input is empty
stdout
2.000000 3.666667 4.222222 4.407407 4.469136 4.489712 4.496571 4.498857 4.499619 4.499873