fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. #include <stdio.h>
  5.  
  6. int main(void) {
  7. int i, j,k, min, temp, q;
  8. int arr[5]={2,4,6,3,1};
  9. for(i=0;i<5;i++)
  10. {
  11. min=arr[i];
  12. k=i;
  13. while(k>5)
  14. {
  15. if(min>arr[k])
  16. {
  17. min==arr[k];
  18. j=k;
  19. }
  20. k++;
  21. }
  22. temp=arr[i];
  23. arr[i]=min;
  24. arr[j]=temp;
  25. }
  26. printf("sorted list\n");
  27. for(q=0;q<5;q++)
  28. {
  29.  
  30. printf("%d",arr[q]);
  31. }
  32. // your code goes here
  33. return 0;
  34. }
  35.  
  36. // your code goes here
  37. return 0;
  38. }
  39.  
Success #stdin #stdout 0s 4416KB
stdin
Standard input is empty
stdout
Standard output is empty