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