fork download
  1. #include<stdio.h>
  2. int function(int array[],int size){
  3. static int j= -3;
  4. int i;
  5.  
  6. if(size > 3)return 3;
  7. for(i=size -1 ; i>= 0 ; i--){
  8. array[i] += j;
  9. j=i-j;
  10. }
  11. return j;
  12. }
  13.  
  14. int main(void){
  15. int array[3] = {1,2} , i,j,size=1;
  16.  
  17. for(i=0;i<2;i++){
  18. size =function(array,size);
  19. printf("array: ");
  20. for(j=0;j<3;j++)
  21. printf("%d ",array[j]);
  22. printf("\n");
  23. }
  24. return 0;
  25. }
Success #stdin #stdout 0.01s 1676KB
stdin
Standard input is empty
stdout
array: -2 2 0 
array: 0 1 3