fork(1) download
  1. #include <stdio.h>
  2.  
  3. main() {
  4. int LA[] = {1,3,5,7,8};
  5. int k = 3, n = 5;
  6. int i, j;
  7.  
  8. printf("The original array elements are :\n");
  9.  
  10. for(i = 0; i<n; i++) {
  11. printf("LA[%d] = %d \n", i, i[LA]);
  12. }
  13.  
  14. j = k;
  15.  
  16. while(j < n) {
  17. (j-1)[LA] = j[LA];
  18. j = j + 1;
  19. }
  20.  
  21. n = n - 1;
  22.  
  23. printf("The array elements after deletion :\n");
  24.  
  25. for(i = 0; i<n; i++) {
  26. printf("LA[%d] = %d \n", i, i[LA]);
  27. }
  28.  
  29. printf("LA[%d] = %d \n", 4, 4[LA]);
  30. }
Success #stdin #stdout 0s 2168KB
stdin
Standard input is empty
stdout
The original array elements are :
LA[0] = 1 
LA[1] = 3 
LA[2] = 5 
LA[3] = 7 
LA[4] = 8 
The array elements after deletion :
LA[0] = 1 
LA[1] = 3 
LA[2] = 7 
LA[3] = 8 
LA[4] = 8