fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. int a[10]={3,5,2,4,1,9,7,6,0,8},b,i;
  6. for(i=0;i<=9;i++){
  7. printf("%d ",a[i]);
  8. }
  9. b=a[3];
  10. a[3]=a[0];
  11. a[0]=b;
  12. b=a[5];
  13. a[5]=a[3];
  14. a[3]=b;
  15. b=a[8];
  16. a[8]=a[5];
  17. a[5]=b;
  18. printf("\n");
  19. for(i=0;i<=9;i++){
  20. printf("%d ",a[i]);
  21. }
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0.01s 5288KB
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