Answers for "sort and display by tutors id in ascending order array in c"

0

how to sort array elements in ascending order in c

void nom_du_tab(int *T, int n){
  int i,j;
  int tmp;
  for(i=0;i<n;i++){
    for(j=i+1;j<n;j++){
      if(*(T+i)>*(j+i)){
        tmp=*(T+i);
        *(T+i)=*(T+j);
        *(T+j)=tmp;
      }
    }
  }
  printf(" les elements du tableau par ordre croissant sont :")
  for(i=0;i<n;i++){
    printf("%d",*(T+i));
  }
}
Posted by: Guest on April-12-2022

Code answers related to "sort and display by tutors id in ascending order array in c"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language